Re: retrieve computer serial number

[ DelphiLand FAQ ]

Posted by Joey on March 25, 2004 at 22:17:55:

In Reply to: Re: retrieve computer serial number posted by webmaster Guido on March 25, 2004 at 16:12:28:

Wouldnt a hard drives serial number be always different?? If so then you could just use dat ;)

function GetHardDiskSerial(const DriveLetter: Char): string;
NotUsed: DWORD;
VolumeFlags: DWORD;
VolumeInfo: array[0..MAX_PATH] of Char;
VolumeSerialNumber: DWORD;
GetVolumeInformation(PChar(DriveLetter + ':\'),
nil, SizeOf(VolumeInfo), @VolumeSerialNumber, NotUsed,
VolumeFlags, nil, 0);
Result := Format('Label = %s VolSer = %8.8X',
[VolumeInfo, VolumeSerialNumber])

das a function to get it... but im not quite sure if it will be unique on every harddrive... if im just bein dum dum say ;) heehee

Related Articles and Replies:

[ DelphiLand: free Delphi source code, tips, tutorials ]