If I want to instantiate a DirectoryInfo object with an UNC path
DirectoryInfo myDI = new DirectoryInfo (@"\\server\share");
how can I pass a username / password that is required to access that share?
Thanks
If I want to instantiate a DirectoryInfo object with an UNC path
DirectoryInfo myDI = new DirectoryInfo (@"\\server\share");
how can I pass a username / password that is required to access that share?
Thanks
In .NET 4 this class works perfectly for me to logon in none windows server via UNC.
And this is how to use from your programm
and for the sake of the test you need to use this little function to list all the files in the directory
Try this approach: