Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27085

VS 2010 Making a Trial version of a program and making it Licence version

$
0
0
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...

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

Thanks for help...

Viewing all articles
Browse latest Browse all 27085

Trending Articles