闲坐敲棋

有约不来过夜半,闲敲棋子落灯花

导航

c# 修改注册表

Posted on 2009-06-18 20:05  闲坐敲棋  阅读(172)  评论(0)    收藏  举报

 

  private void Form1_Load(object sender, EventArgs e)
        {

            if (DialogResult.OK == MessageBox.Show("确定要重新安装IE吗?", "提示信息", MessageBoxButtons.OKCancel, MessageBoxIcon.Information))
            {
                RegeditUpdate();// 执行
            }
            else
            {
                // 不执行
            }
            this.Dispose(true);
           
           
        }
        private void RegeditUpdate()
        {
            string path = @"SOFTWARE\Microsoft\Active Setup\Installed Components\{89820200-ECBD-11cf-8B85-00AA005B4383}";

            RegistryKey regKey = Registry.LocalMachine;

            RegistryKey OptionKey = regKey.OpenSubKey(path, true);

            OptionKey.SetValue("IsInstalled", "0");

        }