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?
Éric MoreauConnect With a Mentor Senior .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.
É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
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.