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.
精彩评论