hello,
i'm having a bit of trouble reading a default value from the registry, and
i'm wondering if anyone else has run into this. this is the code i use
Dim key As Microsoft.Win32.RegistryKey
key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Clients\Mail")
Dim name As String = CType(key.GetValue("(Default)"), String)
MessageBox.Show(name)
this returns a blank string but when i view the view with regedit the
(Default) key has a value (the value is currently Outlook Express. i thought
it might me a problem with the key being with () but if i add a key (testkey)
and assign it a value, then modify my code to key.GetValue("(testkey)"), the
value of the test key shows up .
has anyone else seen this of am i querying the registy incorrectly?
Jorge Serrano [MVP VB] - 27 Oct 2004 18:23 GMT
Hi Gabe,
use this sentence:
Dim name As String = CType(key.GetValue(name, "DEFAULT-VALUE"),
String)
Kind Regards,
Jorge Serrano Pérez
MVP VB.NET
> hello,
> i'm having a bit of trouble reading a default value from the registry, and
[quoted text clipped - 12 lines]
> value of the test key shows up .
> has anyone else seen this of am i querying the registy incorrectly?
gabe - 27 Oct 2004 18:35 GMT
that worked perfectly.
thank-you
> Hi Gabe,
>
[quoted text clipped - 23 lines]
> > value of the test key shows up .
> > has anyone else seen this of am i querying the registy incorrectly?