• <legend id='xaBnw'><style id='xaBnw'><dir id='xaBnw'><q id='xaBnw'></q></dir></style></legend>
    • <bdo id='xaBnw'></bdo><ul id='xaBnw'></ul>
    <i id='xaBnw'><tr id='xaBnw'><dt id='xaBnw'><q id='xaBnw'><span id='xaBnw'><b id='xaBnw'><form id='xaBnw'><ins id='xaBnw'></ins><ul id='xaBnw'></ul><sub id='xaBnw'></sub></form><legend id='xaBnw'></legend><bdo id='xaBnw'><pre id='xaBnw'><center id='xaBnw'></center></pre></bdo></b><th id='xaBnw'></th></span></q></dt></tr></i><div id='xaBnw'><tfoot id='xaBnw'></tfoot><dl id='xaBnw'><fieldset id='xaBnw'></fieldset></dl></div>
    <tfoot id='xaBnw'></tfoot>

      <small id='xaBnw'></small><noframes id='xaBnw'>

        枚举 Windows 中所有可用的驱动器号

        时间:2023-07-31

          <tfoot id='l61fJ'></tfoot>

              <bdo id='l61fJ'></bdo><ul id='l61fJ'></ul>
              <legend id='l61fJ'><style id='l61fJ'><dir id='l61fJ'><q id='l61fJ'></q></dir></style></legend>

              <small id='l61fJ'></small><noframes id='l61fJ'>

            • <i id='l61fJ'><tr id='l61fJ'><dt id='l61fJ'><q id='l61fJ'><span id='l61fJ'><b id='l61fJ'><form id='l61fJ'><ins id='l61fJ'></ins><ul id='l61fJ'></ul><sub id='l61fJ'></sub></form><legend id='l61fJ'></legend><bdo id='l61fJ'><pre id='l61fJ'><center id='l61fJ'></center></pre></bdo></b><th id='l61fJ'></th></span></q></dt></tr></i><div id='l61fJ'><tfoot id='l61fJ'></tfoot><dl id='l61fJ'><fieldset id='l61fJ'></fieldset></dl></div>
                    <tbody id='l61fJ'></tbody>

                  本文介绍了枚举 Windows 中所有可用的驱动器号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想使用 VC++ 枚举 Windows 中所有可用的驱动器号(尚未使用).

                  I want to enumerate all available drive letters (which aren't already taken) in Windows using VC++.

                  我该怎么做?

                  推荐答案

                  ::GetLogicalDrives() 返回可用(读取:已使用)驱动器列表作为掩码中的位.这应该包括映射的网络驱动器.因此,您可以简单地遍历这些位以查找为零的位,这意味着不存在驱动器.如果有疑问,您可以随时致电 ::GetDriveType() 带有驱动器号 + ":" (":\" 在 C 代码中,或 _T(":\") 在 Unicode 感知术语中,当然),如果驱动器可用,应该返回 DRIVE_UNKNOWNDRIVE_NO_ROOT_DIR.

                  ::GetLogicalDrives() returns a list of available (read: used) drives as bits in a mask. This should include mapped network drives. Thus, you can simply walk the bits to find bits that are zero, meaning no drive is present. If in doubt, you can always call ::GetDriveType() with the drive letter + ":" (":\" in C code, or _T(":\") in Unicode-aware terminology, of course), and that should return DRIVE_UNKNOWN or DRIVE_NO_ROOT_DIR if the drive is available.

                  这篇关于枚举 Windows 中所有可用的驱动器号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 UpdateResource 更新字符串表 下一篇:如何获取 Windows“特殊文件夹"的路径?对于特

                  相关文章

                  最新文章

                  <small id='VR6bZ'></small><noframes id='VR6bZ'>

                  <legend id='VR6bZ'><style id='VR6bZ'><dir id='VR6bZ'><q id='VR6bZ'></q></dir></style></legend>

                  1. <i id='VR6bZ'><tr id='VR6bZ'><dt id='VR6bZ'><q id='VR6bZ'><span id='VR6bZ'><b id='VR6bZ'><form id='VR6bZ'><ins id='VR6bZ'></ins><ul id='VR6bZ'></ul><sub id='VR6bZ'></sub></form><legend id='VR6bZ'></legend><bdo id='VR6bZ'><pre id='VR6bZ'><center id='VR6bZ'></center></pre></bdo></b><th id='VR6bZ'></th></span></q></dt></tr></i><div id='VR6bZ'><tfoot id='VR6bZ'></tfoot><dl id='VR6bZ'><fieldset id='VR6bZ'></fieldset></dl></div>

                    <tfoot id='VR6bZ'></tfoot>
                      • <bdo id='VR6bZ'></bdo><ul id='VR6bZ'></ul>