来一帖:<br>下面这个函数可以显示是否就绪。(From Borland)<br><br>function DiskInDrive(Drive: Char): Boolean;<br>var ErrorMode: word;<br>begin<br>{ make it upper case }<br>if Drive in ['a'..'z'] then Dec(Drive, $20);<br>{ make sure it's a letter }<br>if not (Drive in ['A'..'Z']) then<br>raise EConvertError.Create('Not a valid drive ID');<br>{ turn off critical errors }<br>ErrorMode := SetErrorMode(SEM_FailCriticalErrors);<br>try<br>{ drive 1 = a, 2 = b, 3 = c, etc. }<br>if DiskSize(Ord(Drive) - $40) = -1 then<br>Result := False<br><br>else<br>Result := True;<br>finally<br>{ restore old error mode }<br>SetErrorMode(ErrorMode);<br>end;<br>end;<br>