Question

I have built an application with a tree view showing the file structure of the server the application is running on. 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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top