|
-
Nov 27th, 2001, 11:07 PM
#1
Thread Starter
Junior Member
How to create the 30-day limit on eval program?
Great Ones,
I'm writing a demo version of a program I'm intending to ultimately sell...but I want the demo version to only operate for 30-days.
What is the best way to go about programming such a 30-day lock?
Thank you in advance,
Jeff
-
Nov 27th, 2001, 11:32 PM
#2
Good Ol' Platypus
You could create a log in the registry saying what the install date was and what the date is now, therefore in 30 days exiting immediately. However, they could set it to be a day before that to overcome it. You'd probably have to do some kind of counter to get it to work properly.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Nov 28th, 2001, 12:53 AM
#3
Thread Starter
Junior Member
How to log/read/write in the Registry?
Sastraxi,
Your idea sounds great. I would just 'encrypt' (with some sort of simle formula) the two dates, making it harder for them to trivially 'hack' the dates. But how do you register and read/write into the registry from VB. Do you have an example or know where I could look in MSDN for example?
Thank you
-
Nov 28th, 2001, 07:37 AM
#4
-= B u g S l a y e r =-
VB Code:
'Author: Reginald Wheat
Option Explicit
Public Function DateGood(NumDays As Integer) As Boolean
'The purpose of this module is to allow you to place a time
'limit on the unregistered use of your shareware application.
'This module can not be defeated by rolling back the system clock.
'Simply call the DateGood function when your application is first
'loading, passing it the number of days it can be used without
'registering.
'
'Ex: If DateGood(30)=False Then
' CrippleApplication
' End if
'Register Parameters:
' CRD: Current Run Date
' LRD: Last Run Date
' FRD: First Run Date
Dim TmpCRD As Date
Dim TmpLRD As Date
Dim TmpFRD As Date
TmpCRD = Format(Now, "m/d/yy")
TmpLRD = GetSetting(App.EXEName, "Param", "LRD", "1/1/2000")
TmpFRD = GetSetting(App.EXEName, "Param", "FRD", "1/1/2000")
DateGood = False
'If this is the applications first load, write initial settings
'to the register
If TmpLRD = "1/1/2000" Then
SaveSetting App.EXEName, "Param", "LRD", TmpCRD
SaveSetting App.EXEName, "Param", "FRD", TmpCRD
End If
'Read LRD and FRD from register
TmpLRD = GetSetting(App.EXEName, "Param", "LRD", "1/1/2000")
TmpFRD = GetSetting(App.EXEName, "Param", "FRD", "1/1/2000")
If TmpFRD > TmpCRD Then 'System clock rolled back
DateGood = False
ElseIf Now > DateAdd("d", NumDays, TmpFRD) Then 'Expiration expired
DateGood = False
ElseIf TmpCRD > TmpLRD Then 'Everything OK write New LRD date
SaveSetting App.EXEName, "Param", "LRD", TmpCRD
DateGood = True
ElseIf TmpCRD = Format(TmpLRD, "m/d/yy") Then
DateGood = True
Else
DateGood = False
End If
End Function
'Usage
Private Sub Form_Activate()
If Not DateGood(30) Then
MsgBox "Trial Period Expired!", vbExclamation, "Unregistered application"
Unload Me
End If
End Sub
yet another sample
-
Nov 28th, 2001, 07:44 AM
#5
SaveSetting would be almost worse then an ini, or simple text file stored in the program Directory. Do a search for "VB" in your registry,, and you should find a folder eventually that has nothing but Registry Entires put there using SaveSetting. This location is the same in everyone's registry.
If you are going to use the registry, look up the Registry functions in MSDN, and learn to use them. Hide your settings with some strage name, in some strange place.
You might also want to create a binary file in your Windows\System32 directory, renamed to <something>.DLL. Encrypt the date so there is nothing but numbers. The first number in the file should be the length of the date, then the date, followed by several kilobytes of junk.
Z.
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
|