Save value to registery : Registry « Windows « C# / C Sharp





Save value to registery


  using System;
  using System.Resources;
  using Microsoft.Win32;

  using System.Diagnostics;
  class Test
  {
    static void Main(string[] args)
    {
      // Save user prefs to reg.
      RegistryKey regKey = Registry.CurrentUser;
      regKey = regKey.CreateSubKey("Software\\Intertech\\YourKeyRes");
      regKey.SetValue("CurrSize", "29");
      regKey.SetValue("CurrColor", "Red");
      Console.WriteLine("Settings saved in registry");

    }
  }
   
           
       










Related examples in the same category

1.Read value from registry
2.Retrieve the CPU Type and Speed from the Registry
3.Write a Text and DWord Value to the Registry
4.Enumerating Registry Keys
5.Get registry value from LocalMachine key