开发者

c# windows service - check network folder exists

I have a windows service running as local system开发者_C百科, which will search for some files / folders in specified locations.

The problem is when i specify the Path to a Shared folder in Network it will return "Path Not Found"

i have set

serviceProcessInstaller1.Account = ServiceAccount.LocalSystem;

but i tried ServiceAccount.NetworkService by setting UserName and Password using this.Context.Parameters[key].ToString()

at this time nothing happens

for ServiceAccount.LocalSystem if i set "Log On" property through "Services.msc" it will work fine. but need it to achieve through code.


You need to run your service under a user account that has rights to the network volumes. Typically this means one of your domain accounts. None of the built in service accounts will have such rights.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜