如何解决There is no disk in the drive的错误?
我用Delphi编写了一个读取USB里数据的软件。
程序自动扫描计算机所有USB设备,很简单,代码如下:
procedure GetUsbDrives(List: TStringList);var DriveBits: set of 0..25; I: Integer; Drive: AnsiChar;begin List.BeginUpdate; try Cardinal(DriveBits) := GetLogicalDrives; for I := 0 to 25 do if I in DriveBits then begin Drive := Chr(Ord('a') + I); if GetBusType(Drive) = BusTypeUsb then begin List.Add(Drive); end; end; finally List.EndUpdate; end;end;