Qt 文件 API 类在 Windows 上正确处理网络文件夹路径。但是我找不到枚举网络根目录的方法(可用的网络驱动器和计算机列表)。有没有什么方法可以不使用 WinAPI 而只使用 Qt 类来做到这一点?
最佳答案
恐怕,你能得到的最好的是QStorageInfo来自 QtSystems。
allLogicalDrives : const QStringList
This property holds the list of all drives.
Returns a list of all logical drives or volumes, or an empty list if no drives are found or on error.
然后,您可以使用方法来查询 uri、根据“远程”类型进行过滤等。
关于c++ - 是否可以使用 Qt 类枚举网络根?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23195757/