using Microsoft.Win32; 
//写入
RegistryKey softwareKey = Registry.LocalMachine.OpenSubKey("Software", true);
RegistryKey myKey = softwareKey.CreateSubKey("myKey");
myKey.SetValue("key1", (object)"value1");
//读取
RegistryKey softwareKey = Registry.LocalMachine.OpenSubKey("Software");
RegistryKey myKey = softwareKey.OpenSubKey("myKey");
string strValue = (string)myKey.GetValue("key1");
浙公网安备 33010602011771号