Hi friends, Below is my trial code to run program for certain day.... but if user reverse the computer date the program can proceed to work... How to rectify this I need help from you guys... Thanks in advance Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim TimesLoaded As Integer = My.Settings.TimesRun Dim FirstRun As Date If TimesLoaded = 0 Then 'App has never run before, we need to save the FirstRun Date My.Settings.FirstRun = Now My.Settings.Save() End If FirstRun = My.Settings.FirstRun 'Tick up the counter TimesLoaded += 1 My.Settings.TimesRun = TimesLoaded My.Settings.Save() 'Did the Trial Period expire, or has the app ben run more times than allowed? Dim Expired As Boolean = CBool(TimesLoaded > Max_Times_Loaded OrElse DateDiff(DateInterval.Day, FirstRun, Now) >= 2) If Expired Then MsgBox("Sorry Times up") End If End Sub
Last edited: