VB.net initiating the trial period in security software

In the following demo application


I imported Form1 into my project as well as the two class modules.

I run the code behind  "Test Status" as my main form starts

and have noticed that it says that I have 30 days left for the past three

days. What do I do to get the Trial days ticking down?
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
are you sure that CreateRegKeys has been called successfully at least once?
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
I don't think it has. As you can see I have moved the code around and call the procedure
oTest_Status as my main form loads. When this code runs the
variable strOldDay  contains the value "1EB9F900E0B160247FF8C9B899DE541B"
So CreateRegKeys(txtPassPhrase.Text) never runs. Should I perhaps just
run the CreateRegKeys(txtPassPhrase.Text) the very first time my app is run?
I had run your Demo project. Maybe that ran CreateRegKeys(txtPassPhrase.Text)

    Private Sub btnApplicationStatus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnApplicationStatus.Click
        Call oTest_Status()
    End Sub

    Public Sub oTest_Status()
            Dim oReg As Microsoft.Win32.RegistryKey
            oReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software", True)
            oReg = oReg.CreateSubKey(kstrRegSubKeyName)
            oReg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\" & kstrRegSubKeyName)
            Dim strOldDay As String = oReg.GetValue("UserSettings", "").ToString
            Dim strOldMonth As String = oReg.GetValue("operatingsystem", "").ToString
            Dim strOldYear As String = oReg.GetValue("GUID", "").ToString
            Dim strRegName As String = oReg.GetValue("USERID", "").ToString
            Dim strRegCode As String = oReg.GetValue("LOCALPATH", "").ToString
            Dim strCompID As String = oReg.GetValue("CompID", "").ToString
            Dim strTrialDone As String = oReg.GetValue("Enable", "").ToString

            'If the keys should automatically be created, then create them.
            If strOldDay = "" Then
            End If
Éric MoreauSenior .Net ConsultantCommented:
You have to run it so something is written into the registry because this key is used to know when the trial period started.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.