My Service is LocalSystem (can't be used user, because it must run on server)
If I use:
File.AppendAllText(@"\\10.0.20.1\Public\fld\file.txt", "Text");
I get this exception:
System.IO.IOException: The user name or password is incorrect.
I tried class from Simple-access-to-network-drive
using (NetworkShareAccesser.Access("10.0.20.1", @"ABC\\", @"ABC\\User123", "Password"))
{
File.AppendAllText(@"\\10.0.20.1\Public\fld\file.txt", "Text");
}
But I got exception "The specified username is invalid".
Thanks.