c++ - 是否可以使用 Qt 类枚举网络根?

标签 c++ windows qt filesystems qtsystems

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/

相关文章:

c++ - 将其 ASCII 的 int 转换为 String

c++ - 在构建 C++ 项目时增加相关错误

windows - Docker native Windows 支持?

c++ - 在 Qtcp readyRead() 中读取可变长度消息

QtQuick-FolderListModel 未显示所有文件

c++ - Qt精密定时器计时精度

c++ - 我正在处理 Prototype does not match in any class error in c++

C++17 和十进制浮点的当前状态

php - 自动安排和执行 PHP 脚本

html - 从 html 文件中删除 br 标签