There is a server iis site asp.net, which is twisted in a domain. There is a file of the share that is not in the domain, with authorization by login and password.
A Task: This share should be used to save user files there, keeping them there and to see again through asp.net.
Already tried and did not work:
NetworkCredential theNetworkCredential = new NetworkCredential(@"username", "password");
CredentialCache theNetCache = new CredentialCache();
theNetCache.Add(new Uri(@"\\computer"), "Basic", theNetworkCredential);
string[] theFolders = Directory.GetDirectories(@"\\computer\share");
While working on the test machine. But apparently uses some special port that get blocked on work server.
How to provide user name and password when connecting to a network share - connects a network drive, and work is not entirely correct.