Click to See Complete Forum and Search --> : Request Registry Key?


megaxoom
February 15th, 2004, 02:24 PM
Hello everyone

I am writing the following code to retrieve a value from the registry, but cannot succeed.

RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Test\\Fold", true);

The rk is always null, even though I have created the Test\\Fold key in the registry.

Anyone knows what I did wrong. Thanks for any help.

busyweb
March 14th, 2004, 11:32 PM
Dim rk As RegistryKey = Registry.LocalMachine.OpenSubKey("Software\KeyName", False)
Dim s As String = CType(rk.GetValue("key"), String)