启用注册表:
RegistryKey rgK = Registry.CurrentUser;
rgK.DeleteSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
禁用注册表:
RegistryKey rgK = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
rgK.SetValue("DisableRegistryTools", 1, RegistryValueKind.DWord);