OpenNETCF Registry

  • Thread starter Thread starter =?ISO-8859-15?Q?Roland_Lie=DF?=
  • Start date Start date
?

=?ISO-8859-15?Q?Roland_Lie=DF?=

Hallo,

How can i get a registry value?
Following code doesn't work.

RegistryKey rk = Registry.CurrentUser
Object obj = rk.GetValue("HKEY_CURRENT_USER\\Start\\dummy")

obj == null, why? The registry value 'dummy' exist.

Best regards
Roland

--
Roland Ließ
Bergfeldstr. 13
38704 Liebenburg
Phone: 05346-947422
Mobil: 0162-4761058
EMail: (e-mail address removed)
 
The key name is relative to the root level key used - so if you have opened
CurrentUser you don't put this in your key name. Also don't confuse the key
name with the value name e.g.

RegistryKey rk = Registry.CurrentUser.OpenKey("Start");

object obj = rk.GetValue("dummy");

rk.Close();

It works just the same as the desktop equivalent in Microsoft.Win32 (and now
in .NETCF v2.0)

Peter
 
Hallo Peter,
The key name is relative to the root level key used - so if you have opened
CurrentUser you don't put this in your key name. Also don't confuse the key
name with the value name e.g.

RegistryKey rk = Registry.CurrentUser.OpenKey("Start");

object obj = rk.GetValue("dummy");

rk.Close();

It works just the same as the desktop equivalent in Microsoft.Win32 (and now
in .NETCF v2.0)
Thank you, now it works.


--
Roland Ließ
Bergfeldstr. 13
38704 Liebenburg
Phone: 05346-947422
Mobil: 0162-4761058
EMail: (e-mail address removed)
 
Back
Top