How to save Values To Registry

This code shows how to save Values To Registry

C# code


using Microsoft.Win32;
//In Button Click Event
RegistryKey regkey = Registry.CurrentUser;
//path to save values
regkey = regkey.CreateSubKey("Software\\Hello");
//Content of values
regkey.SetValue("WORLD", "2009", RegistryValueKind.String);
regkey.SetValue("SOFTWARE", "VER 1.0", RegistryValueKind.String);


That's All
Open Registry Editor to view result


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: