What is this about?
Hey Guys! In this tutorial I'm going to show you how to protect your program with your Windows Serial Key.
Original Thread (by me): http://www.hackforums.net/showthread.php?tid=727561
How does it work?
It compares two serial keys! Your serial key (you set it in the source), and the serial key of the computer (Windows OS) you're using.
If the serial of the computer doesn't match with that you chose the program won't run.
So, how do I code that?
Step 1) Add to your project 2 forms (Form1 and Form2).
Form2 will be your program and Form1 will be the protection.
Step 2) Make your form1 invisible by changing its opacity to 0, and setting the ShowInTaskbar and ShowIcon to False.
Step 3) Add a label to your form1.
Step 4) Lets make our form1 imports Management.
Step 5) Now lets declare some variables.
Step 6) Now just add the folowing code to your form1_load event.
This will compare your Windows OS serial with the one you chose.
Step 7) Create your program in Form2.
Step 8) Test it!
Hope you find use for this!
Hey Guys! In this tutorial I'm going to show you how to protect your program with your Windows Serial Key.
Original Thread (by me): http://www.hackforums.net/showthread.php?tid=727561
How does it work?
It compares two serial keys! Your serial key (you set it in the source), and the serial key of the computer (Windows OS) you're using.
If the serial of the computer doesn't match with that you chose the program won't run.
So, how do I code that?
Step 1) Add to your project 2 forms (Form1 and Form2).
Form2 will be your program and Form1 will be the protection.
Step 2) Make your form1 invisible by changing its opacity to 0, and setting the ShowInTaskbar and ShowIcon to False.
Step 3) Add a label to your form1.
Step 4) Lets make our form1 imports Management.
Code:
Imports System.Management
Step 5) Now lets declare some variables.
Code:
Dim MOS As ManagementObjectSearcher = New ManagementObjectSearcher("Select * From Win32_OperatingSystem")
Dim MO As System.Management.ManagementObject
Dim MOC As System.Management.ManagementObjectCollection = MOS.Get
Dim WindowsSerial As String = String.Empty
Step 6) Now just add the folowing code to your form1_load event.
Code:
For Each MO In MOC
WindowsSerial = MO("SerialNumber")
Next
Label1.Text = WindowsSerial
If Label1.Text = "YOUR WINDOWS SERIAL" Then
Form2.Show()
Me.Hide
Else
MsgBox("Your windows serial does not match.")
Me.close
End If
This will compare your Windows OS serial with the one you chose.
Step 7) Create your program in Form2.
Step 8) Test it!
Hope you find use for this!