Attached is a project (actually two projects) that show one way of having the user register his copy of your program. This is the way it works:
The main application displays a registration screen with two options: "Register" and "Request Registration Key".
If the user selects "Register" a new screen is shown that asks the user for his name and tells him that if he continues it will generate an e-mail message to you (via MAPI) and that you will send him the registration key by return e-mail. If he continues, the program gets his hard drive serial number and includes it in the e-mail to you.
Once you receive the registration request email, you use the second project (GenKey) to generate a registration key by way of a simple algorithm that you can change based on the hard drive serial number. Just remember that the algorithm is in both projects and it must be exactly the same in both.
You then send the registration key back to the user and have them enter it in the second part of the registration screen which writes the key to the registry.
When they start the main program again it uses the same algorithm to see if the registration key in the Registry matches the HD serial number. If it matches the program starts (see Notes below). If it doesn't match or if there is no registry entry, the program does not start or you could arrange it so that it starts with only a few demo functions available.
Notes:
Your main form must be shown using vbModal.
You will need to modify the program to change the constant named EMAIL to your e-mail address.
You should change the registration key algorythm. See CalcRegKey in modProtect and Sub Main in modGenKey. The changes should be the same in both places.
Pretty neat, I did this a while back for an application of mine that I never got around to releasing...I really want to fix a few bugs in it and then release it to the public. It is of great help to me and my friends.
Just one small bug I found in the keygen project, which I thought I should share in case anyone is using this technique to create keys -- on my PC, the Serial Number generated was a minus number. If I put that in the keygen, an invalid procedure call error occurred.
Originally posted by MartinLiss I doubt it. Check your code against mine and if you can't find anything wrong, zip up your code and I'll take a look at it.
Thing is I never changed your code - I just was testing it.
Then I don't know what is going on since 187 other people have downloaded it and no one that I know of has experienced your problem. I know the code works on both NT4 and XP. What is your operating system?
Originally posted by MartinLiss Then I don't know what is going on since 187 other people have downloaded it and no one that I know of has experienced your problem. I know the code works on both NT4 and XP. What is your operating system?
XP - I must be special
Maybe because of the HD - because its a laptop? Im guessing here...
I don't know what's happening on your PC. What option do you choose when you see the form that says "In order for you to be able to use the full funtionality..."?
Originally posted by MartinLiss I don't know what's happening on your PC. What option do you choose when you see the form that says "In order for you to be able to use the full funtionality..."?
Hm - well it wont let me open that way anymore because i registered myself but I dont remember choosing an option at all! =/
Cool - first time editing the registry but did as asked.
Now when i click register it goes to the whole registration form this - where you enter your key etc....
If you've modified the email address in the application like I suggested above, then
Choose the Request Registration Key option.
That should result in you receiveing an email containing your HD serial number.
Take that serial number and run it through the GenKey application.
GenKey will give you the registration key.
Run the Protect application again, selecting the Register option
Enter the key and you're done.
BTW, both applications contain an algorythm that starts strLicenseKey = CStr(Int. You'll probably want to change that in both applications (the same way) so that your calculation will be different from other people who use this registration scheme.
I think that basing any registration scheme off any one piece of hardware is a very bad idea, and extremely bad for business.
I would hate to think that I couldn't reinstall my Visual Studio because my hard drive died, or I upgraded to a larger one and needed to reinstall......
Originally posted by JasonC I think that basing any registration scheme off any one piece of hardware is a very bad idea, and extremely bad for business.
I would hate to think that I couldn't reinstall my Visual Studio because my hard drive died, or I upgraded to a larger one and needed to reinstall......
I would call it a disadvantage rather than a bad idea. Yes, if you are going to have thousands of users then you might want to use some other scheme, but unfortunately not many of us will face that "problem". For most of us, if one of our users needs to replace their hard drive, all they need to do is to request a new registration key. I have not had to do that for anyone yet, but just in case, I keep a record of my users with names, HD serial numbers, date requested, etc.
Consider this. While a thief can break a window to get into a house even though the door may be locked, he will most likely check the doors first and enter the house that is unlocked. The point is that while no security method is foolproof, it still makes sense to "lock the door".
Originally posted by MartinLiss Consider this. While a thief can break a window to get into a house even though the door may be locked, he will most likely check the doors first and enter the house that is unlocked. The point is that while no security method is foolproof, it still makes sense to "lock the door".
Originally posted by MartinLiss Consider this. While a thief can break a window to get into a house even though the door may be locked, he will most likely check the doors first and enter the house that is unlocked. The point is that while no security method is foolproof, it still makes sense to "lock the door".
Excellent point
Has someone helped you? Then you can Rate their helpful post.
Ah yes... the problem is not OS specific; Some hardware manufacturers don't embed serial number information in their parts.
As far as evexa's drive returning a 0, this is quite possible. There are utilities such as those available from Sysinternals and PowerQuest (or even DOS's Debug) to edit or completely remove the VSN.
As an alternative, a combination of the Motherboard, Processor, BIOS, and Disk serial numbers could still be used. The formula to manipulate the strLicenseKey would have to be changed, but that should be fairly straight forward.
For JasonC, simply exclude the Disk serial number so he can swap out his hard drive
And for cgi, he's right... if someone wants something bad enough, they'll do anything to get it. But your "locked door" analogy is right on the money... Locks were designed to keep honest people honest.
Use it if you like it... if not, at least you have stimulated our thought processes.
VB Code:
Private Sub Form_Load()
Dim List
Dim Msg
Dim Object
On Local Error Resume Next
Set List = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_BaseBoard")
Its a good idea to use all those serial numbers - but- asnd this is a newbie talking... What if it wasnt able to grasp one of the numbers - or the number changes - like for example if they swap hard drives... maybe its better just to use ONE source for SNs
Ok, I need some help using this. I made the downloaded file a .exe. And I registered it, but then when I got to the happy face screen, and pressed ok it exited. Then I thought okt hats registered but when I open it again I have to register it again
It's got to have something to do with the way you modified the SaveSetting and GetSetting calls in the program. There are 2 places where SaveSetting is used and 3 places where GetSetting is used. Can you show what you did in those 5 places please?