If you are going to post this anywhere else remember to give credits to me
Hello, In this tutorial i will show you how to make a basic login with off line hwid.
What you will need:
4 Labels
2 Edit Boxes
1 Button
Setting up the application layout:
First we will need to add our labels which can be found here:
Next we will need to add our edit boxes which is located here:
Finally we will need to add our button which is found here:
Now your application should look similar to this:
Renaming:
To Rename as label1 click it once and go to the side panel and edit the text to 'User name:'
Now do the same for label2 but instead change the text to 'Password:'
Now do the same for label3 but change the name to 'Your Hwid:'
Next remove the text from label4 and place it next to label 3 like so:
Finally click Button1 and go to the side panel and change the text to 'Login'
Your application should now look like this:
Adding the code to the application:
Now we will need to double click our Button and type in the following code:
Next we will need to add the function to do this add the following code under here:
Finally double click your form and add the following code into it:
Hello, In this tutorial i will show you how to make a basic login with off line hwid.
What you will need:
4 Labels
2 Edit Boxes
1 Button
Setting up the application layout:
First we will need to add our labels which can be found here:
Next we will need to add our edit boxes which is located here:
Finally we will need to add our button which is found here:
Now your application should look similar to this:
Renaming:
To Rename as label1 click it once and go to the side panel and edit the text to 'User name:'
Now do the same for label2 but instead change the text to 'Password:'
Now do the same for label3 but change the name to 'Your Hwid:'
Next remove the text from label4 and place it next to label 3 like so:
Finally click Button1 and go to the side panel and change the text to 'Login'
Your application should now look like this:
Adding the code to the application:
Now we will need to double click our Button and type in the following code:
Code:
If (edit1.text = 'user') and (edit2.Text = 'password') then
begin
If GetHwid() = 'Your Hwid Here' then
form2.Show
else
application.terminate;
end;
end;
Next we will need to add the function to do this add the following code under here:
Code:
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;
Finally double click your form and add the following code into it:
Code:
Label4.Caption := getHWID();[code]
[IMG]http://shadyshosting.com/Delphi/Login With Offline HWID Tut/348r7us.jpg[/IMG]
Now add another form you can do so by going here:
[IMG]http://shadyshosting.com/Delphi/Login With Offline HWID Tut/lz874.jpg[/IMG]
Finally lets test the program what should happen is all will be fine until they click login and then it will check to see if there Hwid is valid to the one stored in the program if it is then form2 will show but if it isn't then the application will terminate.
Hope you enjoyed my tutorial.