|
-
Aug 29th, 2002, 02:27 PM
#1
Thread Starter
Addicted Member
How to Make Trial Period
What is the best way to make my application expired at certain date ?
Registry change ?
Thank you all !
-
Aug 29th, 2002, 03:02 PM
#2
Addicted Member
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:
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
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!
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!!!
Not at all related to sheep...
-
Aug 29th, 2002, 03:59 PM
#3
Thread Starter
Addicted Member
knock me up a module !
That sounds interesting,
I could wait till you are back from the islands.
Thank you.
-
Aug 29th, 2002, 05:03 PM
#4
Addicted Member
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).
Not at all related to sheep...
-
Aug 29th, 2002, 05:08 PM
#5
PowerPoster
Well
Create a text file in obscure place on the system. Place the date, encrypted within the textfile. Wala, done....
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Aug 29th, 2002, 05:17 PM
#6
Addicted Member
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.
Not at all related to sheep...
-
Aug 29th, 2002, 05:37 PM
#7
Need-a-life Member
-
Aug 29th, 2002, 05:49 PM
#8
PowerPoster
Well
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...
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Aug 29th, 2002, 05:49 PM
#9
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.
-
Aug 30th, 2002, 04:21 AM
#10
Addicted Member
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
-
Aug 30th, 2002, 08:26 AM
#11
-
Jul 7th, 2003, 12:30 AM
#12
-
Jul 7th, 2003, 02:28 AM
#13
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.
Tips:
- Google is your friend! Search before posting!
- Name your thread appropriately... "I Need Help" doesn't cut it!
- Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
- Allways Include the Name and Line of the Exception (if one is occuring!)
- If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)
If you think I was helpful, rate my post  IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|