I've Added a Setting named Trial_Start_Date and set it as Date type.
My plan is to leave the value Null in my project and then when I send my program to a prospect, my form load code would check this value and if Null (running for the first time), it would write that current date value to this file and then not run for more than 10 days.
I get an error in my code when I try to set Trial_Start_Date to Today(). It tells me it's Read-Only, but I don't see anywhere to set this be be writeable ??
VB.Net Project Properties
Settings Tab:
Trial_Start_Date Date
Dim Trial_Expired As Boolean = False
If IsDBNull(My.Settings.Trial
_Start_dat
e) = True Then
My.Settings.Trial_Start_Da
te = Today()
End If
If My.Settings.Trial_Start_Da
te.AddDays
(10) < Now Then
Trial_Expired = True
Else
Trial_Expired = False
End If
If Trial_Expired = True Then
MessageBox.Show("This trial version has reached the end of the 10 day trial.")
Application.Exit()
End If
Thanks,
JMO9966
Start Free Trial