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

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
commented: its really helpful..tq +1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.