C# - Accessing SMB shares
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Hi guys, I'm trying to access an SMB share hosted on an AS400 server. The server is nothing to do with the domain security. My windows server needs to periodically access this folder and read/write to some files. The access security is managed by the server. The path is: "\\qfgmas400\STX\mvx_desp". If i try something like: DirectoryInfo fi = new DirectoryInfo(@"\\qfgmas400\STX\mvx_desp"); FileInfo[] fia = fi.GetFiles(); I get an UnauthorizedAccessException. Any ideas how i can pass a username and a password to connect to the share? Cheers Will