Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Improved program trial
#1
A little while ago I posted a video tutorial on how to make your application a 30 day trial. Well, after reviewing that video I realized that the code was long obsolete. So here is a new code.

[code2=vbnet]'This variable, trialLength is the number of days you want your free trial (or paid) to last.
Dim trialLength As Integer = 7
If My.Settings.startdate.Year = 1 Then
'Date has not yet been set, set it for today
My.Settings.startdate = My.Computer.Clock.LocalTime
Else
'Date has already been set, check for # days
Dim ts As New TimeSpan(-trialLength, 0, 0, 0, 0)
If My.Settings.startdate.Subtract(My.Computer.Clock.LocalTime) <= ts Then
'This part of the code occurs if the trial is finished
MsgBox("7 Day trial ended!")
Else
'Trial has not yet ended
MsgBox("You're good.")
End If
End If[/code2]

So simply adjust the trialLength variable to how many days you want your trial to last, and put this into your form load sub!
My Blog | My Setup | My Videos | Have a wonderful day.


Messages In This Thread
Improved program trial - by brandonio21_phpbb3_import2 - 08-05-2011, 09:36 PM
Re: Improved program trial - by openeXpressions - 11-22-2011, 11:20 AM
Re: Improved program trial - by AnchoredFTW - 12-27-2011, 07:40 AM
Re: Improved program trial - by zmanalpha - 12-28-2011, 08:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Making Your Program Start with Windows brandonio21 0 8,632 04-09-2013, 03:10 PM
Last Post: brandonio21

Forum Jump:


Users browsing this thread: 1 Guest(s)