A
AliR \(VC++ MVP\)
Hi everyone,
I'm trying to read and write a value from the registry. My write routine
works fine, after it runs I can see the item in the registry.
But when I read it back I keep getting a 1 back.
Here is the code:
Write to registry:
RegistryKey key =
Registry.CurrentUser.OpenSubKey("software\\LearnStar A+ TurningPoint XR
Client",true);
if (key == null)
{
key = Registry.CurrentUser.CreateSubKey("software\\LearnStar
A+ TurningPoint XR Client");
}
key.SetValue("Channel",channelCtrl.Value,RegistryValueKind.DWord);
Read from it:
RegistryKey key =
Registry.CurrentUser.OpenSubKey("software\\LearnStar A+ TurningPoint XR
Client");
int channel =
(int)key.GetValue("Channel",10,RegistryValueOptions.None);
channelCtrl.Value = channel;
channelCtrl is a NumericUpDown control
Thanks
AliR.
I'm trying to read and write a value from the registry. My write routine
works fine, after it runs I can see the item in the registry.
But when I read it back I keep getting a 1 back.
Here is the code:
Write to registry:
RegistryKey key =
Registry.CurrentUser.OpenSubKey("software\\LearnStar A+ TurningPoint XR
Client",true);
if (key == null)
{
key = Registry.CurrentUser.CreateSubKey("software\\LearnStar
A+ TurningPoint XR Client");
}
key.SetValue("Channel",channelCtrl.Value,RegistryValueKind.DWord);
Read from it:
RegistryKey key =
Registry.CurrentUser.OpenSubKey("software\\LearnStar A+ TurningPoint XR
Client");
int channel =
(int)key.GetValue("Channel",10,RegistryValueOptions.None);
channelCtrl.Value = channel;
channelCtrl is a NumericUpDown control
Thanks
AliR.