之前的帖子没有答案, 这次换过一个专家问:)>>>上一贴查看

解决方案 »

  1.   

    1、在设备管理器中查看
    2、使用ChipGenius工具查看(点击官方下载详细信息
      

  2.   

    注册表中可能相关的键:
    1、USB设备列表
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR2、有USB设备插入时,这里会新增键值,拔出时相应删除
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum3、本机装载过的盘符
    HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
      

  3.   

    可以使用wmi获得
    uses ActiveX, ComObj;procedure TForm1.Button1Click(Sender: TObject);
    var
      Locator: OleVariant;
      WMI: OleVariant;
      RET: OleVariant;
      Enum: IEnumVariant;
      Tmp: OleVariant;
      Value: Cardinal;
    begin;
      Locator := CreateOleObject('WbemScripting.SWbemLocator');
      WMI := Locator.ConnectServer('.', '', '', '');
      Ret := WMI.ExecQuery('SELECT * FROM Win32_USBHub');
      Enum:= IUnknown(RET._NewEnum) as IEnumVariant;
      while (Enum.Next(1, Tmp, Value) = S_OK) do
         Memo1.Lines.Add(Tmp.Name + ' = ' + Tmp.PNPDeviceID);
    end参考如下结构:
    ms-help://MS.MSDNQTR.v80.chs/MS.MSDN.v80/MS.WIN32COM.v10.en/wmisdk/wmi/win32_usbhub.htm
    class Win32_USBHub : CIM_USBHub
    {
      uint16 Availability;
      string Caption;
      uint8 ClassCode;
      uint32 ConfigManagerErrorCode;
      boolean ConfigManagerUserCode;
      string CreationClassName;
      uint8 CurrentAlternativeSettings;
      uint8 CurrentConfigValue;
      string Description;
      string DeviceID;
      boolean ErrorCleared;
      string ErrorDescription;
      boolean GangSwitched;
      datetime InstallDate;
      uint32 LastErrorCode;
      string Name;
      uint8 NumberOfConfigs;
      uint8 NumberOfPorts;
      string PNPDeviceID;
      uint16 PowerManagementCapabilities[];
      boolean PowerManagementSupported;
      uint8 ProtocolCode;
      string Status;
      uint16 StatusInfo;
      uint8 SubclassCode;
      string SystemCreationClassName;
      string SystemName;
      uint16 USBVersion;
    };
      

  4.   

    这里查出来PNPDeviceID, 但是没有盘符。
      

  5.   

    这个结构没有盘符,Win32_LogicalDisk里面有盘符,但是看了半天,没有关联字段-_-!!
      

  6.   

    Win32_LogicalDisk 的PNPDeviceID是空的,DeviceID也是盘符。class Win32_LogicalDisk : CIM_LogicalDisk
    {
      uint16 Access;
      uint16 Availability;
      uint64 BlockSize;
      string Caption;
      boolean Compressed;
      uint32 ConfigManagerErrorCode;
      boolean ConfigManagerUserConfig;
      string CreationClassName;
      string Description;
      string DeviceID;
      uint32 DriveType;
      boolean ErrorCleared;
      string ErrorDescription;
      string ErrorMethodology;
      string FileSystem;
      uint64 FreeSpace;
      datetime InstallDate;
      uint32 LastErrorCode;
      uint32 MaximumComponentLength;
      uint32 MediaType;
      string Name;
      uint64 NumberOfBlocks;
      string PNPDeviceID;
      uint16 PowerManagementCapabilities[];
      boolean PowerManagementSupported;
      string ProviderName;
      string Purpose;
      boolean QuotasDisabled;
      boolean QuotasIncomplete;
      boolean QuotasRebuilding;
      uint64 Size;
      string Status;
      uint16 StatusInfo;
      boolean SupportsDiskQuotas;
      boolean SupportsFileBasedCompression;
      string SystemCreationClassName;
      string SystemName;
      boolean VolumeDirty;
      string VolumeName;
      string VolumeSerialNumber;
    };
      

  7.   

    找到了几个相关的贴,一并贴在这马克:)
    在VB中对硬盘的底层操作大全(一)
    在VB中对硬盘的底层操作大全(二)
    在VB中对硬盘的底层操作大全(三)
      

  8.   

    http://cache.baidu.com/c?m=9f65cb4a8c8507ed4fece7631047892e4309c76037ddd01774d4935f93130b1f1a33f4bb5078474e94996b6776fe1403f7f33571340527bc9adf8f3e8bac925f75ce786a6459db0144dc42f29a007bd621e04deedb0ee6cab174ceee8186884352ba44020e97f1fb0f5752dd6e80033697b19838430854e1bc6772fe29602eeb3441c61bbebf623947&p=987b840399904eaa03bd9b7f0e07&user=baidu用DeviceIoControl的IOCTL_STORAGE_GET_DEVICE_NUMBER和IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS即可
      

  9.   


    不知楼主解决没有?
    楼主要求的是不是,插入多个u盘,可以根据u盘的盘符显示序列号同时对应显示u盘的盘符,如果解决了,能不能把代码贴一下看看?