📜  c# 写入注册表 hkey_current_user - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:46.995000             🧑  作者: Mango

代码示例1
//accessing the CurrentUser root element  
//and adding "OurSettings" subkey to the "SOFTWARE" subkey  
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\OurSettings"); 

//storing the values  
key.SetValue("Setting1", "This is our setting 1");  
key.SetValue("Setting2", "This is our setting 2");  
key.Close();