[Delphi] Get hwid in delphi

A Place For Programmers Of All Levels To Discuss Programming & Web Building.

Moderator: Community Moderator

Post Reply
User avatar
djfshady
Corporal
Corporal
Posts: 25
Joined: 26 Nov 2010, 20:12
Location: United Kingdom
Been thanked: 5 times
Contact:

[Delphi] Get hwid in delphi

Post by djfshady »

First add 1 label then

add this code after an

Code: Select all

end;
on your form.

Code: Select all

function getHWID(): String;
var
SerialNum,A,B: DWord;
C: array [0..255] of Char;
Buffer: array [0..255] of Char;
begin
if GetVolumeInformation(pChar('C:\'), Buffer, 256, @SerialNum, A, B, C, 256) then
  Result := inttostr(SerialNum * Cardinal(-1))
else Result := '';
end;
next add this code by double clicking your form name.

Code: Select all

label1.caption := GetHwid();
Image
Post Reply

Return to “Programming/Web Building Chat & Support”