Question:
Every hardisk has serial number, it will be an advantage to get this serial. Possibly I can use it to prevent my application install by twice at same hard disk.
May i get the code?
Answer:
Sure, actually some application using not only serial of harddisk but also windows serial, cpu serial and network number to do some restriction.
Anyway, here the code you want:
function GetHardDiskSerial(const DriveLetter: Char): string;
var
NotUsed: DWORD;
VolumeFlags: DWORD;
VolumeInfo: array[0..MAX_PATH] of Char;
VolumeSerialNumber: DWORD;
begin
GetVolumeInformation(PChar(DriveLetter + ':\'),
nil, SizeOf(VolumeInfo), @VolumeSerialNumber, NotUsed,
VolumeFlags, nil, 0);
Result := Format('Label = %s VolSer = %8.8X',
[VolumeInfo, VolumeSerialNumber])
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(GetHardDiskSerial('c'));
end;
Subscribe to:
Post Comments (Atom)






I have heard about another way of Recover MDB. Besides, you can visit my blogs at: http://daspeac.livejournal.com/ or http://daspeac.blogspot.com/ where I’m trying to share my experience with regard to data corruption issues