This question already has an answer here:
- Enumerating network shares 1 answer
I'm trying to get all directories of a remote server.
For example:
path: "\\Servename\folder"
- it works!
path: "\\Servename"
- error
I tried this:
DirectoryInfo dir = new DirectoryInfo (@"\\SERVERNAME"); <- Error happens here
//Get Directories from \\SERVERNAME
DirectoryInfo[] dirInfos = dir.GetDirectories();
Error: ERROR: The UNC path should be of the form \\server\share