Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net registry reading writing

Tags:

c#

.net

Can you refer me to some good reference how I can read write to registry via .net resources ?

I checked the site and couldn't find any good information.

like image 687
Night Walker Avatar asked Feb 03 '23 07:02

Night Walker


2 Answers

Check out the Registry class in the BCL

  • http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx

Example:

using(var key = Registry.CurrentUser.OpenSubKey(@"Software\MyProduct")) {
  var value = key.GetValue("SomeValueKey");
  ..
}
like image 160
JaredPar Avatar answered Feb 07 '23 19:02

JaredPar


Look at Microsoft.Win32.Registry. There is an abundance of sample code there. You can also look at CodeProject. Lastly, MSDN has a good overview on the Registry.

like image 45
jason Avatar answered Feb 07 '23 18:02

jason