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

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.

This article has been dead for over six months. Start a new discussion instead.