WinForm 禁用和启用 注册表

禁用注册表:

View Code
   RegistryKey rgK = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
                rgK.SetValue("DisableRegistryTools", 1, RegistryValueKind.DWord);
                MessageBox.Show("禁用成功!!!");

启用注册表

View Code
  RegistryKey rgK = Registry.CurrentUser;
                rgK.DeleteSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
                MessageBox.Show("启用成功!!!");

posted on 2012-06-23 23:34  refactor  阅读(446)  评论(0编辑  收藏  举报

导航