设置IE浏览器的默认主页
实现效果:

知识运用:
RegistryKey类的GetValue方法
public Object GetValue (string name , Object defaultValue)
name : 要检索的值的名称
defaultValue: 在name不存在时返回的值
实现代码:
private void Form1_Load(object sender, EventArgs e)
{
RegistryKey regMain = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\Main");
object DPage = regMain.GetValue("Start Page","没有值");
textBox1.Text = DPage.ToString();
}
private void button1_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(textBox2.Text))
{
RegistryKey regMain = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\Main");
regMain.SetValue("Start Page", textBox2.Text);
MessageBox.Show("已设置主页为:"+textBox2.Text);
}
}
private void button2_Click(object sender, EventArgs e)
{
RegistryKey regMain = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\Main");
regMain.SetValue("Start Page", "about:blank");
MessageBox.Show("已设置主页为:"+"空白页");
}
设置IE浏览器的默认主页的更多相关文章
- 设置IE浏览器的默认下载路径
实现效果: 知识运用: Default Download Directory键 实现代码: private void button2_Click(object sender, EventArgs e) ...
- WIN10:IE浏览器的默认主页以及通过链接搜索的默认引擎
主页设置: 地址栏搜索引擎:
- IIS设置默认主页无效
服务器系统:Windows server 2008 R2 IIS版本:7.5 IIS中部署一个dotnet framework 3.5的网站应用程序,设置"默认文档"为:index ...
- 微软更新导致的IIS7设置默认主页无效
近期两个superKM的老客户出现问题,网站不能自动检索默认文档,必须通过完整网址才能访问. 值得一提的是出现问题的都是 IIS7 和7.5版本,服务器为windows server2008 R2. ...
- RK3288 修改浏览器默认主页和书签
path:packages/apps/Browser/res/values/strings.xml 修改浏览器默认主页: <!-- The default homepage. --> &l ...
- Nginx+Tomcat多站点访问默认主页问题-狒狒完美解决-Q9715234
<Engine name="Catalina" defaultHost="www.abc.com"> <Host name="www ...
- 修改apache默认主页,重定向404页面
yum 下载apache后默认主页 默认配置文件: vim /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/welcome.conf 跳转页面到 /var/w ...
- 修改TOMCAT默认主页
1.默认的项目都在目录:apache-tomcat-9.0.0.M22\webapps\ROOT下 2.该目录下有一个index.jsp是tomcat的默认主页,如下 3.现在需要修改这个默认主页,改 ...
- 纯 JS 设置文本框的默认提示
HTML5 中有个新特性叫 placeholder,一般用它来描述输入字段的预期值,适用于 text.search.password 等类型的 input 以及 textarea.示例如下: < ...
随机推荐
- linux中Python源码安装和配置
安装 首先获取安装包,此处版本为3.7 wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz 解压 tar xvf Python- ...
- Linux软件安装的补充
1 使用yum 命令查看软件提供的版本 yum list mysql* 然后比如说都需要安装我们就可以执行命令: yum install mysql* 然后就会安装所有的.会显示所有需要安装的包,和需 ...
- 字典表+委托替代switch解决思路
参考:http://www.jianshu.com/p/8887b3b3e8ba 代码 namespace 解决Switch { class Program { delegate string fun ...
- 【python爬虫】用python编写LOL战绩查询
介绍一个简单的python爬虫,通过Tkinter创建一个客户端,当输入要查询的LOL用户名称的时候,可以显示出当前用户的所在服务器,当前战力和当前段位. 爬取网页地址:http://lol.duow ...
- MySQL关联left join 条件on与where不同
以下的文章主要讲述的是MySQL关联left join 条件on与where 条件的不同之处,我们现在有两个表,即商品表(products)与sales_detail(销售记录表).我们主要是通过这两 ...
- ACdream 1099——瑶瑶的第K大——————【快排舍半,输入外挂】
瑶瑶的第K大 Time Limit:2000MS Memory Limit:128000KB 64bit IO Format:%lld & %llu Submit Status ...
- [转]EntityFramework中常用的数据修改方式
本文转自:http://blog.csdn.net/itmaxin/article/details/47662151 上一篇文章里提到了 EntityFramework中常用的数据删除方式,那么修改对 ...
- c#-cs-bs-正则表达式
C/S B/S Cs结构: C/S(Client/Server)客户机/服务器 BS机构: B/S(Browser/Server)浏览器/服务器 à(未来发展方向) ...
- 解决npm install安装慢的问题
国外镜像会很慢 可用 get命令查看registry npm congfig get registry 原版结果为 http://registry.npmjs.org 用set命令换成阿里的镜像就可以 ...
- js获取客户端用户IP
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script> <script type=& ...