I have a remote host \\foo
that serves up shares: \\foo\a
, \\foo\b
, and \\foo\c
On my local Win 7 client machine, when I bring up Windows Explorer and enter \\foo
in the address bar, it obliges me by showing the names of the 3 shares. The Type attribute for each is "Share"
I have a C# program and I want it to mimic Windows Explorer. I have a method that accepts what should be the a local path name (e.g., C:\x\y\z
), fully-qualified share name (e.g., \\foo\a
), or host name (e.g., \\foo
). The method is to get the names of the items (folder, share, file, 1st level only) contained within the folder, share, or host, just like Windows explorer
File.Exists("\\foo")
and Directory.Exists("\\foo")
both return false
new DirectoryInfo("\\foo")
and File.GetAttributes("\\foo")
throw an exception "The UNC path should be of the form \server\share"
The Path
class seems designed to return just strings and not attributes
Given only the string "\\foo"
, is there a class method/property that will identify it as a host or at least let me test it to see if it is a host and then obtain a list of names that are its children?