电子灵魂

golang,go,C#,JAVA,PYTHON,PHP

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
ie
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace LockIE
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        
        private void button1_Click(object sender, EventArgs e)
        {
            RegistryKey reg = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft\Internet Explorer\MAIN");
            //当键值名为“HomePage”的键值修改为“1”,则禁止修改IE主页
            reg.SetValue("Start Page", 1, RegistryValueKind.String);
            //提示对话框
            MessageBox.Show(this, "禁止修改IE主页设置成功!", "提示对话框", MessageBoxButtons.OK, MessageBoxIcon.Information);

            StrURL.Text.Trim();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //自定义RegistryKey对象实例
            RegistryKey reg = Registry.CurrentUser.CreateSubKey(@"SoftWare\Policies\Microsoft\Internet Explorer\Control Panel");
            //当键值名为“HomePage”的键值修改为“1”,则禁止修改IE主页
            reg.SetValue("HomePage", 1, RegistryValueKind.DWord);
            //提示对话框
            MessageBox.Show(this, "禁止修改IE主页设置成功!", "提示对话框", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            RegistryKey reg = Registry.CurrentUser.CreateSubKey(@"SoftWare\Policies\Microsoft\Internet Explorer\Control Panel");
            //当键值名为“HomePage”的键值修改为“0”,则启动IE浏览器主页的修改
            reg.SetValue("HomePage", 0, RegistryValueKind.DWord);
            //提示对话框
            MessageBox.Show(this, "已启动IE浏览器主页的修改!", "提示对话框", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Close();
        }
        
    }
}
posted on 2015-04-29 10:17  conncent  阅读(388)  评论(0编辑  收藏  举报