Recent Posts
Selamat datang di Coding Delphi Land Weblog kumpulan source code pemogram delphi
(Bukan maksud untuk menggurui tetapi marilah kita berbagi ilmu tuk perkembangan kemajuan teknologi kita
Selasa, 17 November 2009
Deteksi Nama dan Volume Serial Drive
Souce Code
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Edit3: TEdit;
Label3: TLabel;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
VAR lDBPathName: STRING;
VolumeName, FileSystemName: array[0..MAX_PATH - 1] of Char;
VolumeSerialNo: DWord;
MaxComponentLength, FileSystemFlags: cardinal;
a: integer;
b : pansichar;
s:string;
begin
b:=PChar(edit3.Text);
GetVolumeInformation(b, VolumeName, MAX_PATH, @VolumeSerialNo, MaxComponentLength, FileSystemFlags, FileSystemName, MAX_PATH);
edit1.Text:=VolumeName;
edit2.Text:=IntToHex(VolumeSerialNo, 8);
end;
end.
0 komentar:
Posting Komentar