Registry GetValue

  • Thread starter Thread starter JezB
  • Start date Start date
J

JezB

When reading a value from the registry:
string licenceKey = Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\MyProg",
"LicenceKey", "").ToString();

It raises an exception if the path HKEY_LOCAL_MACHINE\Software\MyProg does
not exist. But how do I create it?
 
Use Registry.SetValue.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.
 
Back
Top