枚举树状视图中的网络计算机和共享文件夹列表? [英] Enumerate list of network computers and shared folders in a tree view?

查看:76
本文介绍了枚举树状视图中的网络计算机和共享文件夹列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有很多枚举网络中的计算机和设备的方法,但是如何仅显示可用于Windows文件共享的计算机?我需要提供网络计算机及其共享文件夹的树状视图.我知道我可以为此使用现有的shell控件,但是我宁愿将其保留在自己的树形视图中.它只会列出网络上具有共享文件夹的那些计算机.通过计算机及其共享文件夹后,我可以自己完成单个目录列表部分.我只需要知道如何获取计算机列表及其共享文件夹列表即可.

I know there's plenty ways of enumerating computers and devices on a network, but how do I show just computers available for Windows file sharing? I need to provide a tree view of network computers and their shared folders. I know I could use existing shell controls for this, but I would rather keep it in my own tree view. It will only list those computers on the network which have shared folders. Past the computers and their shared folders, I can do the individual directory listing part myself. I just need to know how to get the computer list and their shared folder lists.

推荐答案

WNetOpenEnum will give you all the computers on the network

WNetOpenEnum函数启动网络资源的枚举或现有连接.您可以通过调用继续枚举 WNetEnumResource 函数

NetShareEnum ,您将全部分享到一台机器.

NetShareEnum will you all shares on a machine.

检索有关服务器上每个共享资源的信息.

Retrieves information about each shared resource on a server.

您可以将两者结合使用,以过滤掉不需要的内容

You can use the combination of both to filter out what you don't want

这篇关于枚举树状视图中的网络计算机和共享文件夹列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆