开发者

Accessing networked computers using C#

开发者 https://www.devze.com 2023-03-29 03:54 出处:网络
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 machin

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消