i am attempting to retrieve a registry setting and set this in a global variable. I have tried to research this problem but havent found much. this is the code:

Module Info
Friend m_Server As String
    Public Sub getserver()
        Dim sRegKey As RegistryKey = Registry.LocalMachine
        sRegKey = sRegKey.OpenSubKey("software\\Normans Professor PC\\Spa Cards")
        m_Server = sRegKey.GetValue("Server").ToString
    End Sub

It seems that this is not firing. Any tips or sugestions will be greatly appreciated.

Thank You

Recommended Answers

All 3 Replies

have solved my problem

For the benefit of the rest of the community, how did you solve it?

of course....

I was trying to pull the information in the module itself. what i had done was set the

friend m_Server as string

in the module
in the splash load i pull my information from the registry and set my variable (m_Server) to the registry setting.

Public Sub getserver()
        Dim sRegKey As RegistryKey = Registry.LocalMachine
        sRegKey = sRegKey.OpenSubKey("software\\Normans Professor PC\\Spa Cards")
        m_Server = sRegKey.GetValue("Server").ToString
    End Sub

Not sure if this the "Correct" way of doing this but its working for settings that are not being changed.

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.