My last explanation is all in psudocode. The functions to encrypt and hash you need to make yourself. If you look in my signature, you'll see I also have an encryption class with some functions you can use to do this.
License systems are just basic cryptography. If you want to learn more about the concepts of license systems, authentication systems, and general encryption and hashing, check out this book. It's absolutely excellent. I outlined the basics of how a hardware-locked function would work. It's up to you now to implement the concept into your program.
You are correct Ansl72, though checkLicense is a variable. The function looks something like this:
Code:
'Hash(String) As String: is a hash function.
'Encrypt(String,String) As String: is an encryption function.
'ReadLicenseFromSavedFile() As String: is a function that reads license data from some saved license file.
'SaveLicenseToFile(String): is a function that saves license data to some saved license file.
'FormDialog_PromptForLicenseKey is a custom dialog that asks for the license key.
'EnableSoftwareFullUse(): is a function for enabling your software as a full version.
'key1 and key2 are the keys used by the encrypt function. They probably shouldn't be stored as plain text like this, but this is a simple example.
Dim key1 As String = "blahblah"
Dim key2 As String = "wibblewibble"
Dim hw As New clsComputerInfo
Dim challengeCode As String = Hash(Encrypt(hw.GetProcessorID() & hw.GetMACAddress(), key1))
Dim licenseKey As String = Hash(Encrypt(challengeCode, key2))
Dim compareKey as String = ReadLicenseFromSavedFile()
If licenseKey = compareKey Then
EnableSoftwareFullUse()
Else
Dim f As New FormDialog_PromptForLicenseKey
If f.ShowDialog = DialogResult.OK Then
SaveLicenseToFile(f.LicenseKeyEntered)
EnableSoftwareFullUse()
Else
Me.Close 'Shut down the software, they are not authorized
End If
End If