delphi 获得usb设备的路径,可以识别usb设备的厂家ID和设备ID. Locator := CreateOleObject('WbemScripting.SWbemLocator'); WMI := Locator.ConnectServer('.', '', '', ''); Ret := WMI.ExecQuery('SELECT * FROM Win32_USBHub');//这里Win32_USBHub为检测项,详见下表 Enum:= IUnknown(RET._NewEnum) as IEnumVariant; ......