M
MadCrazyNewbie
Hey Group,
Im trying to load up some registry Values and display them in Text Box's:
Here is my Code:
Dim RegKeyRead As RegistryKey
'reset the resulting textbox
txtNetworkDevelopmentPath.Text = ""
txtLiveLocalPath.Text = ""
txtLiveNetworkPath.Text = ""
'Try to open the given path
RegKeyRead = Registry.CurrentUser.OpenSubKey("Software\\Excellence",
True)
If RegKeyRead Is Nothing Then
'if the path doesn't exist, warn the user
MessageBox.Show("Error Found")
Exit Sub
End If
'retrieve the subkey and its value (alone with a default value if
the subkey is not found)
"Software\\Excellence" =
RegKeyRead.GetValue(txtNetworkDevelopmentPath.Text, "---Not
Found---").ToString
"Software\\Excellence" = RegKeyRead.GetValue(txtLiveLocalPath.Text,
"---Not Found---").ToString
"Software\\Excellence" =
RegKeyRead.GetValue(txtLiveNetworkPath.Text, "---Not Found---").ToString
'close the key
RegKeyRead.Close()
Only problem is I get a Sysntax Error on "Software\\Excellence".
Could anybody possibly point me in the right direction? also on my Line
"MessageBox.Show("Error Found") How could I get it to tell me which Reg Key
was not found?
Many Many Thanks
MCN
Im trying to load up some registry Values and display them in Text Box's:
Here is my Code:
Dim RegKeyRead As RegistryKey
'reset the resulting textbox
txtNetworkDevelopmentPath.Text = ""
txtLiveLocalPath.Text = ""
txtLiveNetworkPath.Text = ""
'Try to open the given path
RegKeyRead = Registry.CurrentUser.OpenSubKey("Software\\Excellence",
True)
If RegKeyRead Is Nothing Then
'if the path doesn't exist, warn the user
MessageBox.Show("Error Found")
Exit Sub
End If
'retrieve the subkey and its value (alone with a default value if
the subkey is not found)
"Software\\Excellence" =
RegKeyRead.GetValue(txtNetworkDevelopmentPath.Text, "---Not
Found---").ToString
"Software\\Excellence" = RegKeyRead.GetValue(txtLiveLocalPath.Text,
"---Not Found---").ToString
"Software\\Excellence" =
RegKeyRead.GetValue(txtLiveNetworkPath.Text, "---Not Found---").ToString
'close the key
RegKeyRead.Close()
Only problem is I get a Sysntax Error on "Software\\Excellence".
Could anybody possibly point me in the right direction? also on my Line
"MessageBox.Show("Error Found") How could I get it to tell me which Reg Key
was not found?
Many Many Thanks
MCN