Mencari tipe drive dengan delphi

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
typ:Integer;
s : string;
begin
s := 'C:\';
typ := GetDriveType(PChar(s));
if Typ <> 0 then case typ of
DRIVE_REMOVABLE:
begin
ShowMessage('Drive Removable / Diskette');
end;
DRIVE_FIXED:
begin
ShowMessage('Drive fixed');
end;
DRIVE_CDROM:
begin
ShowMessage('CD ROM Drive');
end;
DRIVE_RAMDISK:
begin
ShowMessage('RAM Drive');
end;
DRIVE_REMOTE:
begin
ShowMessage('Remote Drive');
end;
end;
end;

end.

Anda Telah Membaca Mencari tipe drive dengan delphi

Semoga Artikel Mencari tipe drive dengan delphi Bisa Bermanfaat untuk kita semua. Jika Ada Hal yang ingin ditanyakan, Silahkan Komentar atau Hubungi kami via Web Chat yang tersedia