Reputation: 15
I have created a window service in C# 4.0, I have a piece of code to read a file located at remote server. When i try to access that file, I get a error as "Folder does not exist c:/xxx.xx.xx.xx/sharedfolder".
foreach (string subdirectory in Directory.GetDirectories("\\xxx.xx.xx\sharedfolder"))
{
}
But if i run same piece of code on console application it is able to access that folder how i can get rid of it.
Upvotes: 0
Views: 3219
Reputation: 81473
Running a service under the default Local System Account, will have no concept of the share. These are set up under user accounts.
Your 2 options
Upvotes: 3