function SerialNum(Fdrive: string): string;
var
Serial, DirLen, Flags: Dword;
DLabel: array[0..11] of char;
begin
try
GetVolumeInformation(Pchar(Fdrive+':\'),DLabel,12,@Serial,DirLen, Flags, nil, 0);
Result := IntToHex(Serial,8);
except
Result := '';
end;
end;
Usage:
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption := 'Drive serial = ' + SerialNum('c');
end; Steven van Els
SAvanEls@cq-link.sr
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.