加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

禁止运行注册表

发布时间:2020-12-14 02:35:20 所属栏目:Windows 来源:网络整理
导读:实现效果: 知识运用: DisableRegistryTools键 / /设置是否允许运行注册表程序 1 表禁止 0 为允许 实现代码: private void button1_Click(object sender,EventArgs e) { try { RegistryKey rk = Registry.CurrentUser.CreateSubKey("SoftwareMicrosoftW

实现效果:

  

知识运用:

  DisableRegistryTools键    //设置是否允许运行注册表程序

  1 表禁止 0 为允许

实现代码:

        private void button1_Click(object sender,EventArgs e)
        {
            try
            {
                RegistryKey rk = Registry.CurrentUser.CreateSubKey("SoftwareMicrosoftWindowsCurrentVersionPoliciesSystem");
                rk.SetValue("DisableRegistryTools",1,RegistryValueKind.DWord);
                MessageBox.Show("注册表禁用成功!");
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }
        }
        private void button2_Click(object sender,RegistryValueKind.DWord);
                MessageBox.Show("注册表启用用成功!");
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }
        }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读