What is the best way to make my application expired at certain date ?
Registry change ?
Thank you all !:rolleyes:
Printable View
What is the best way to make my application expired at certain date ?
Registry change ?
Thank you all !:rolleyes:
Well, you could use the registry, BUT you couldn't do it using a key called "ExpiresOn" and filling it with "Wednesday" or something like that. To stop people from changing the key, you have to encrypt it. This can be done easily!
OK, say you want it to expire in 30 days, and the install program makes the registry key that your program checks with, when it gets installed. Make a name for the key (let's call it "ExpiresOn", and let it contain a date which your program sets when it first starts). Instead of saving "Monday, July 4th" you use the attached MD5String() function to hash it, then save it. Now, to the pesky user, it looks like "ExpiresOn" - "a8dd73jn9f399f3jvb", and trust me the chances that they can decode that to the correct time and change it are so small that you could promise to kill yourself if they did. So now the date's in the registry and you wanna check up on it. Since there is no UnMD5String() function, you just need to use something like this:
The On Error statement ensures that if the user thought she'd be clever and remove the key entirely, it still doesn't let them in!VB Code:
On Error GoTo Error Dim i As 'Whatever format the date was in For i = Today To 30-Days-Time If Module1.MD5String(i) <> 'the registry key entry EXACTLY Then Error: 'sod off! Exit Sub Else 'come on in! End If Next i
Does this help? If you want, I can knock you up a module which can do ALL of this for you, but you'd have to wait a few days!!!
That sounds interesting,
I could wait till you are back from the islands.
Thank you.
OK Sure, just give me the name/path of the reg key you want to put the expiry time in. You need to get your app to create it though!
I should have this finished by Saturday (I'm busy tomorrow).
Create a text file in obscure place on the system. Place the date, encrypted within the textfile. Wala, done....
It's better to store the information in the registry, for the same reason that applications stopped using .ini files a few years ago and migrated to using the registry. And don't ask me for the reason because I don't know, I'm just sure that since applications now use the registry, there must be something better about it.:D ;)
Each user can have their customized configuration. All you have to do is to save their configuration in the HKCU. In the INI case, you would need to create an INI for each user, or different keys for each user in the same INI file.Quote:
Originally posted by A$$Bandit
It's better to store the information in the registry, for the same reason that applications stopped using .ini files a few years ago and migrated to using the registry. And don't ask me for the reason because I don't know, I'm just sure that since applications now use the registry, there must be something better about it.:D ;)
But all he wants to do is terminate use of his app at a set interval...
If you must use registry, I still suggest using a text file as extra security...;)
You can use this activeX control: http://www.activelock.com/faq.html
It has source code too if you want to modify it to your liking or just get ideas to make your own.
Hi A$$Bandit,
What if the user changes the date? I mean if the user installed on 1st Sept., registry entry will contain 30th Sept in encrypted format.
But if the user manages that the date in his system never reaches 30th Sept then?
Can you elaborate a little bit on this?
Thanks in advance,
Satya
http://www.vbforums.com/showthread.p...ght=clock+back Check peet's code.Quote:
Originally posted by SatyaPhaniKumar
Hi A$$Bandit,
What if the user changes the date? I mean if the user installed on 1st Sept., registry entry will contain 30th Sept in encrypted format.
But if the user manages that the date in his system never reaches 30th Sept then?
Can you elaborate a little bit on this?
Thanks in advance,
Satya
If only people searched... :rolleyes:
It's true.... If user can change system date then he can use the software after the expiry date. here is 1 solution add encrypted string in registry and check that string everytime in ur programme and if the user use ur software **** times then change that value to some special string and if u found that string in registry then show message and end ur programme.
I'm sure if u used this technique no 1 can hack ur software...... :D ;)
Nothing is safe, they can disassemble your app and make it not check. Basicly if they want to use ur app and they got enough know-how they will. All you can do is make it harder but checking it in lots of locations and making the check part of core functions that need to be called.