Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to develop a time limited version of software 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
If i want add a functionality to my COM Object that after certain number of days the evaluation version should expire and user can not use the same untill he purchases a full license.

Any leads on this particular work are appreciated. And It would be more helpful if some one posts an code clip or some site link.

Regards
Kris
 
Hi,

If you still need this...


Option Explicit

Public Function DateGood(NumDays As Integer) As Boolean
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
msgbox "System Date Has Been Tampered With."
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


Then use it


Private Sub Form_Activate()
If Not DateGood(30) Then
MsgBox "Your 30 Day Trial Period Is Over!", _
vbExclamation, _
"Unregistered application"
Unload Me
End If
End Sub


You'll however have to build some way of accepting a registration key depending on your preferred method/algorithm.

Ciao
Phathi :-V
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top