C#注册表常用操作
1:加鍵 改值
Microsoft.Win32.RegistryKey Key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey( @"Software\Microsoft\Internet Explorer\Main"); Key.SetValue( "Window Title" , value ); Key.Close();
2:獲取鍵值
Microsoft.Win32.RegistryKey Key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey( @"Software\Microsoft\Internet Explorer\Main"); return Key.GetValue( "Window Title" ).ToString();
3:刪鍵
Microsoft.Win32.RegistryKey Key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies"); Key.DeleteSubKeyTree( "Ratings" ); Key.Close();
Microsoft.Win32.RegistryKey Key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey( @"Software\Microsoft\Internet Explorer\Main"); Key.SetValue( "Window Title" , value ); Key.Close();
?
2:獲取鍵值
Microsoft.Win32.RegistryKey Key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey( @"Software\Microsoft\Internet Explorer\Main"); return Key.GetValue( "Window Title" ).ToString();
?
3:刪鍵
Microsoft.Win32.RegistryKey Key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies"); Key.DeleteSubKeyTree( "Ratings" ); Key.Close();
?
?
?
轉載于:https://www.cnblogs.com/onsuccessway/p/3410664.html
總結
- 上一篇: VC++ 使用attributes定义接
- 下一篇: c# streamReader转XmlD