Powered by Blogger.

Mengecek Disk Pada Disk Drive

Apabila Anda tidak ingin melihat pesan “A:\ is not accessible. The Device not Ready” saat Anda mengakses disk drive yang kosong (tidak terdapat disket pada disk drive), gunakan kode berikut ini :

procedure TForm1.Button1click(Sender : TObject);
  1. begin
  2.     if not DirectoryExists('a:\') then
  3.       MessageDlg('Disk drive kosong',mtError,[mbOk],0)       else
  4.       {jika disk drive tidak kosong maka ……}
  5. end;
Maka saat user mengakses disk drive yang kosong, akan muncul pesan yg lebih mudah dipahami, yaitu “Disk drive kosong”.

Semoga Bermanfaat.

0 komentar:

Post a Comment