比如说我的电脑里有C,D,E,三个区,但是我加上了一个移动硬盘后,有多了F,H,G,三个区,我怎么区别F,H,G,是移动硬盘啊?

解决方案 »

  1.   

    GetDriveType
    The GetDriveType function determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. UINT GetDriveType(
      LPCTSTR lpRootPathName   // root directory
    );Value Meaning 
    DRIVE_UNKNOWN The drive type cannot be determined. 
    DRIVE_NO_ROOT_DIR The root path is invalid. For example, no volume is mounted at the path. 
    DRIVE_REMOVABLE The disk can be removed from the drive. 
    DRIVE_FIXED The disk cannot be removed from the drive. 
    DRIVE_REMOTE The drive is a remote (network) drive. 
    DRIVE_CDROM The drive is a CD-ROM drive. 
    DRIVE_RAMDISK The drive is a RAM disk. 
      

  2.   

    GetDriveType("f:")==DRIVE_REMOVABLE      //可移动存储设备
    GetDriveType("f:")==DRIVE_FIXED          //固定硬盘。
      

  3.   

    有人提诗在上头
    UINT GetDriveType(
      LPCTSTR lpRootPathName   // root directory
    );Value Meaning 
    DRIVE_UNKNOWN The drive type cannot be determined. 
    DRIVE_NO_ROOT_DIR The root path is invalid. For example, no volume is mounted at the path. 
    DRIVE_REMOVABLE The disk can be removed from the drive. 
    DRIVE_FIXED The disk cannot be removed from the drive. 
    DRIVE_REMOTE The drive is a remote (network) drive. 
    DRIVE_CDROM The drive is a CD-ROM drive. 
    DRIVE_RAMDISK The drive is a RAM disk. 不过GetDriveType("f:")==DRIVE_REMOVABLE      //可移动存储设备?
    好象是软盘来的。USB 是不是另有值呢?
    其实USB的驱动必须是WDM模型,功能设备对象FDO和物理设备对象PDO。一硬件仅一个PDO。通过GUID 来表示设备。
    GUID ClassGuid=UsbDeiceName—CLAA—GUID
    用Hdebice打开打不开就知道是不是USB了。
      

  4.   

    http://expert.csdn.net/Expert/topic/1662/1662504.xml?temp=.5560724