Jul 19, 2000 #1 Gigatech Programmer Jul 12, 2000 80 CR Delphi 5. How can I get an unique number for a specific PC, for example HDD Serial Number or Motherboard serial number?<br>Thanks.
Delphi 5. How can I get an unique number for a specific PC, for example HDD Serial Number or Motherboard serial number?<br>Thanks.
Jul 20, 2000 #2 pwesson Programmer Apr 10, 2000 95 CA Try this...<br><br>function GetVolumeSerialNumber: string;<br>var<br> NotUsed, VolFlags: DWORD;<br> VolSN: DWORD;<br> VolumeSerialNumber: string;<br>begin<br> SetCurrentDirectory(pChar(ExtractFilePath(Application.ExeName)));<br> GetVolumeInformation(nil, nil, 0, @VolSN, NotUsed, VolFlags, nil, 0);<br> VolumeSerialNumber := AnsiUpperCase(IntToHex(VolSN, 8));<br> Result := Copy(VolumeSerialNumber, 1, 4) + '-' + Copy(VolumeSerialNumber, 5, 4);<br>end;<br> <p>Paul Wesson<br><a href=mailtoaul@wessoft.com>paul@wessoft.com</a><br><a href=http://www.wessoft.com/>Paul Wesson, Programmer/Analyst</a><br> Upvote 0 Downvote
Try this...<br><br>function GetVolumeSerialNumber: string;<br>var<br> NotUsed, VolFlags: DWORD;<br> VolSN: DWORD;<br> VolumeSerialNumber: string;<br>begin<br> SetCurrentDirectory(pChar(ExtractFilePath(Application.ExeName)));<br> GetVolumeInformation(nil, nil, 0, @VolSN, NotUsed, VolFlags, nil, 0);<br> VolumeSerialNumber := AnsiUpperCase(IntToHex(VolSN, 8));<br> Result := Copy(VolumeSerialNumber, 1, 4) + '-' + Copy(VolumeSerialNumber, 5, 4);<br>end;<br> <p>Paul Wesson<br><a href=mailtoaul@wessoft.com>paul@wessoft.com</a><br><a href=http://www.wessoft.com/>Paul Wesson, Programmer/Analyst</a><br>