磁盘类型 GetDriveType

//磁盘类型 GetDriveType
var
Drive: Char;
DriveLetter: String[
4];
begin
for Drive := 'A' to 'Z' do
begin
DriveLetter :
= Drive + ':\';
case GetDriveType(PChar(Drive + ':\')) of
DRIVE_REMOVABLE:
Memo1.Lines.Add(DriveLetter
+ ' Floppy Drive');
DRIVE_FIXED:
Memo1.Lines.Add(DriveLetter
+ ' Fixed Drive');
DRIVE_REMOTE:
Memo1.Lines.Add(DriveLetter
+ ' Network Drive');
DRIVE_CDROM:
Memo1.Lines.Add(DriveLetter
+ ' CD-ROM Drive');
DRIVE_RAMDISK:
Memo1.Lines.Add(DriveLetter
+ ' RAM Disk');
end;
end;
end;

posted on 2008-11-05 14:23  jxgxy  阅读(423)  评论(0编辑  收藏  举报

导航