I have built an application with a tree view showing the file structure of the server the application is running 开发者_如何学Con. I want to be able to include in the tree the file structure of machines connected through the network.
Something like this but with multiple workgroups.
The only example I have found which is similar so far is this example which simply lists machines connected through the network, whereas I want access to the folders within them.
Thanks in advance for any help
This will get an array of directory names (String[]
) assuming the process is running as an account with access to the share:
var folders = Directory.GetDirectories(@"\\HOSTNAME\ShareName\");
You can use a similar method to bind the entries to a TreeView
. You'd need to update your question to include whatever UI code you're using.
精彩评论