{GetDriveType}
//调用 GetDriveTypeA(Memo1);
procedure GetDriveTypeA(Memo:TMemo);
var
i: Integer;
C:String;
DType: Integer;
DriveString:String;
begin
//通过循环依次判断各盘符的类型
Memo.Clear;
for i:=65 to 90 do
begin
C:=chr(i)+':\';
DType:=GetDriveType(PChar(C));
case DType of
0: DriveString :=C+' 不能判断的驱动器类型.';
1:
DriveString :=C+' 根目录不存在.';
DRIVE_REMOVABLE: DriveString:=C+' 可移动驱动器';
DRIVE_FIXED : DriveString:=C+' 硬盘驱动器.';
DRIVE_REMOTE : DriveString:=C+' 网络驱动器.';
DRIVE_CDROM : DriveString:=C+' 光盘驱动器.';
DRIVE_RAMDISK : DriveString:=C+' 虚拟硬盘.';
end;
Memo.Lines.Add(DriveString);
end;
end;