代码之家  ›  专栏  ›  技术社区  ›  Mark

python win32-映射驱动器上的driveinfo

  •  2
  • Mark  · 技术社区  · 16 年前

    有人知道我如何确定映射网络驱动器的服务器和共享名吗?

    例如:

    import win32file, win32api
    for logDrive in win32api.GetLogicalDriveStrings().split("\x00"):
      if win32file.GetDriveType(logDrive) != win32file.DRIVE_REMOTE: continue
      # get server and share name here
    

    是否有一个方便的API调用?

    谢谢。

    1 回复  |  直到 14 年前
        1
  •  2
  •   Brian R. Bondy    14 年前

    您必须调用win32 api: WNetGetUniversalName