malcomm 0 Newbie Poster

Hi
I have a VB app which includes a small user database. This location of this database is set in registry (HKCU) and read from the client machine (actually server side code) to authenticate the user.
The reason for this is that the Db is installed via a different config app installed on the server so the web client doesn't know the location until it reads the registry value set by the config app.

This all works fine on the VS development machine but I cannot read the registry value from the web app when deployed. I just receive null values.
Same result whether calling the web page from the server (localhost) or the client.
I've mucked about with long enough to guess its probably a permissions thing but I've no idea where to turn now.

This is the code that is called on the server side app to retrieve the registry value-

Public Function RegistryGet(ByVal regKey As String) As String
        Try
            Dim regNode As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\XYZ\appX", True)
            If regNode Is Nothing Then Call RegistryCreate()
            RegistryGet = CStr(regNode.GetValue(regKey, ""))
            If RegistryGet.ToString Is Nothing Then
                RegistryGet = ""
            End If
            regNode.Close()
        Catch ex As Exception
            Return ""
        End Try
    End Function 'RegistryGet

This works fine normally but not on the deployed app. Just returns a null yet it can see the registry key and string.

BTW, there is definitely a string value to read and all the string/key names match up.

Has anyone any experience with reading server registry from a web form?

regards
Malcom

Be a part of the DaniWeb community

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