//聲明:GetDriveType(
//返回值:
lpRootPathName: PChar {磁盤根目錄}
): UINT;DRIVE_UNKNOWN = 0; {未知}
//舉例:
DRIVE_NO_ROOT_DIR = 1; {可移動磁盤}
DRIVE_REMOVABLE = 2; {軟盤}
DRIVE_FIXED = 3; {本地硬盤}
DRIVE_REMOTE = 4; {網絡磁盤}
DRIVE_CDROM = 5; {CD-ROM}
DRIVE_RAMDISK = 6; {RAM 磁盤}
procedure TForm1.FormCreate(Sender: TObject);
var
c: Cardinal;
begin
c := GetDriveType('C:');
ShowMessage(IntToStr(c)); {3; 說明是本地硬盤}
end;