We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Trial system

robjgreen
robjgreen asked
on
Medium Priority
266 Views
Last Modified: 2010-05-03
Anybody got some sample code for a twenty day trial system?

Rob.
Comment
Watch Question

What do you mean? A program that will run for only 20 days since it's installation? How well protected should it be?

Author

Commented:
The user should not be able to stop it from expiring...
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Hi Mike,
   Well, that is actually what I had done already, simply stored it in the registry... but I'm going to test your DateValue idea before I accept the answer (low on points!)

Kind Regs,
Rob Green.
Sorry, I posted it to early. DateValue won't do it, but you can store it like Day*10+Month*500+Year*7000

Author

Commented:
Hi Mike,
   it seems to be working okay... I'll have to get a decent install program that can set these things up though.

Kind Regards,
Rob Green.

Author

Commented:
Mike, erm... well I used this code:

Private Sub Form_Load()
    Dim installdat, currentdate As Long
    frmUnReg.Picture = frmSplash.Picture
    installdate = GetSetting("Heatwave Creations", "PasswordSafe", "gg1", "")
    currentdate = DateValue(Date)
    difference = currentdate - installdate
End Sub

Private Sub Timer1_Timer()
    If (20 - difference) > 0 Then
        frmPasswordSafe.Visible = True
        frmPasswordSafe.Enabled = False
        frmLogin.Visible = True
        Unload Me
    ElseIf (20 - difference) <= 0 Then
        MsgBox "Your Trial Has Expired"
        frmPreferences.Visible = True
        Unload Me
    End If
End Sub

But it doesnt work, it claims I have 40 days remaining!

Can you write me a code example please?

Kind Regards,
Rob Green.
Try something like:
Dim InstallDate as date
installdate = GetSetting("Heatwave Creations", "PasswordSafe", "gg1", "")

If DateDiff("m", Now, InstallDate)>20 then
'Exit
else
'Continue
End if

Author

Commented:
Its okay, I rewrote all the code and it works okay now...
Cant remember what was wrong... too noisy here to think.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.