检查驱动器是否就绪:
|
|
|
作者:佚名
来源:InterNet 加入时间:2004-11-22 |
检查驱动器是否就绪:
下面这个函数可以显示是否就绪。(From Borland)
function DiskInDrive(Drive: Char): Boolean; var ErrorMode: word; begin { make it upper case } if Drive in ['a'..'z'] then Dec(Drive, $20); { make sure it's a letter } if not (Drive in ['A'..'Z']) then raise EConvertError.Create('Not a valid drive ID'); { turn off critical errors } ErrorMode := SetErrorMode(SEM_FailCriticalErrors); try { drive 1 = a, 2 = b, 3 = c, etc. } if DiskSize(Ord(Drive) - $40) = -1 then Result := False else Result := True; finally { restore old error mode } SetErrorMode(ErrorMode); end; end;
[文章录入员:fightter] |
|
|
|
|