Link to home
Start Free TrialLog in
Avatar of davidgm
davidgmFlag for Canada

asked on

How do I set an expiration date for my Visual Basic exe

I have a vb5 program that I would like to expire in 30 days of usage. Your help is appreciated.
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Put this in your Form_Load event:
Dim txt As String
txt = GetSetting(UCase$(App.EXEName), "License", "StartDatim")
If Len(txt$) Then
     If DateDiff("d", Cdate(txt), Now) > 30 Then
          Call DeleteSetting(UCase$(App.EXEName), "License")
          End     'you can replace this with a MsgBox and then provide limited functionality, etc.
     End If
Else
     Call SaveSetting(UCase$(App.EXEName), "License", "StartDatim", Now)
End If