Hello to all,
I have found this fine code, how to make your application Trial version. But how to make it licence version, so when you enter some code, that it make it unlimited...
Thanks for help...
I have found this fine code, how to make your application Trial version. But how to make it licence version, so when you enter some code, that it make it unlimited...
Code:
Private Function HandleRegistry() As Boolean
Dim firstRunDate As Date
firstRunDate = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\MyProg", "FirstRun", Nothing)
If firstRunDate = Nothing Then
firstRunDate = Now
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\MyProg", "FirstRun", firstRunDate)
ElseIf (Now - firstRunDate).Days > 7 Then <--- here, how make it unlimited... What number or operator shoud I put...
Return False
End If
Return True
End Function
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim result As Boolean = HandleRegistry()
If result = False Then 'something went wrong
MsgBox("Trial expired")
Else
MsgBox("Trial version")
End If
End Sub