hi,

If found the DbaseLicenseKey = LicenseKey match i want to write the value to registry but the problem is....i have no idea how to code at this part
AxActiveLockBP.LicenseKey as it gives the error message....

error message = 'LicenseKey' is not a member of 'Axactivelock1884.AxActiveLock'.

Please help!!!

If LicenseKey <> DbaseLicenseKey Then
            MsgBox("Invalid Kiosk Activation Key." & vbCrLf & "Please contact Administrator for Activation Key. Thank you.")
            'if  LicenseKey match then write the value to registry  
        ElseIf DbaseLicenseKey = LicenseKey Then
            AxActiveLockBP.Register(LicenseKey)
            Application.DoEvents()
            newkey = key.CreateSubKey("BPKey").CreateSubKey("BPName").CreateSubKey("Path")
            newkey.SetValue("LiberationKey", AxActiveLockBP.LicenseKey)
        End If

Edited 5 Years Ago by swathys: n/a

Here's the code I use.

Function CreateKey()

        '## Create mCom registry subkey ##
        Dim regKey As RegistryKey

        Try
            regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
            regKey.CreateSubKey("Software\my company\my app")
            regKey.Close()
            Return (True)
        Catch ex As Exception
            MsgBox("Registry Setting Failed: " & ex.Message)
            Return (False)
        End Try

    End Function

    Function SetValue(ByVal subKey As String, ByVal KeyValue As String) As String

        Dim RegKey As RegistryKey = Registry.LocalMachine.OpenSubKey("SoftwareSoftware\my company\my app", True)
        RegKey.SetValue(subKey, KeyValue)
        Return (subKey)

    End Function

    Function GetValue(ByVal SubKey As String) As String

        Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey("SoftwareSoftware\my company\my app", True)
        Dim sValue As String
        sValue = CType(key.GetValue(SubKey), String)
        Return (sValue)

    End Function

    Function SetKey(ByVal KeyValue As String) As String

        Dim regKey As RegistryKey

        regKey = Registry.LocalMachine.OpenSubKey("Software\my company\my app", True)
        regKey.SetValue("Pool", KeyValue)
        regKey.Close()
        Return (True)

    End Function
Comments
its really helpful..tq
This question has already been answered. Start a new discussion instead.