Return to Snippet

Revision: 28416
at July 8, 2010 03:21 by acosonic


Initial Code
Put this at top
using Microsoft.Win32;

Read key
 RegistryKey regKey1 = Registry.LocalMachine.OpenSubKey("SOFTWARE\\test\\Preferences");
 string test = (string)regKey1.GetValue ("TestProperty");

Write key
  RegistryKey masterKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\test\\Preferences");
              
 masterKey.SetValue("TestProperty", "32");
               
masterKey.Close();

Initial URL

                                

Initial Description

                                

Initial Title
C# registry read-write

Initial Tags

                                

Initial Language
C#