This has been discussed in many a forum and to get to the short of it. NO. You cannot guarantee that some user who has bought a license will not install your app on several machines. Well what about hard drive serial numbers? They change if you format them. How about the CPU ID? And if it is disabled by the user because of the outcry of the public when Intel introduced it?
In short, no matter what you do, someone if they really want to will get around everything you try to do to keep your program secure.
Well, if you want to create a "License Key" to activate a program or to enable all of its functions, there are several ways you can do this. Now, if you want to have the ability to have virtually an unlimited number of "License keys" then you need to figure out some sort of formula for creating a key and deciphering the key to check if it is valid. Once you have that, then you need to figure out where your going to store it. More than likely the registry.
So from here I could just go ahead and say good luck, but I don't think you would be satisfied with that as I really have not given you much of an idea on what to do. So here is a thought...
Microsoft now has what 5 fields to enter information in and each field is what 4-5-6 characters? Okay so we will go with that as a basis for our key.
Now lets start with some functions that we can add to any program by just dropping a module or two into said program.
First lets start by using the formula for determining if a number is prime or not (search for it on web).
Now, search for base conversion vb6 on the web. You should be able to find several algorithms that will convert any number from binary to base 36 (0-9+A-Z) or anything in between.
Do you see where I am headed to yet???
We have 5 fields that accept 5 numbers/letters (for arguements sake) and we have a function that will convert any number to any base from binary to base 36, along with a function that will return true or false if a number is a primer number or not.
Now, can you think of a way with using all of that information to be able to generate really large numbers, convert them to whatever base, and order them in such a way as to virtually create a unique key for each paying customer?
I'll quite for now because you really need to come up with your own formula.
Once you have the functionality tested and up and working then use that to make sure your program is licensed prior to showing any form or whatever. Easiest way is to use a sub main, make the call from there and if verified, show your form, if not display license form. If license key valid then show form, else show msgbox saying invalid key, program now exiting.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...