private void button1_Click(object sender, EventArgs e)
{
//从注册表中读取默认浏览器可执行文件路径
RegistryKey key = Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command\");
string s = key.GetValue("").ToString();

//s就是你的默认浏览器,不过后面带了参数,把它截去,不过需要注意的是:不同的浏览器后面的参数不一样!
//"D:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -- "%1"
System.Diagnostics.Process.Start(s.Substring(0, s.Length - 8), "http://blog.csdn.net/testcs_dn");
}

private void button2_Click(object sender, EventArgs e)
{
//调用系统默认的浏览器
System.Diagnostics.Process.Start("explorer.exe", "http://blog.csdn.net/testcs_dn");
}

private void button3_Click(object sender, EventArgs e)
{
//调用系统默认的浏览器
System.Diagnostics.Process.Start("http://blog.csdn.net/testcs_dn");
}

private void button4_Click(object sender, EventArgs e)
{
//调用IE浏览器
System.Diagnostics.Process.Start("iexplore.exe", "http://blog.csdn.net/testcs_dn");
}

C#调用默认浏览器打开网页的几种方法的更多相关文章

  1. (转)C#调用默认浏览器打开网页的几种方法

    转载,原文地址:http://blog.csdn.net/testcs_dn/article/details/42246969 CSharp调用默认浏览器打开网页的几种方法 示例界面: 方法一:从注册 ...

  2. 使用urllib2打开网页的三种方法(Python2)

    python2才有urllib2模块,python3把urllib和urllib2封装成了urllib模块 使用urllib2打开网页的三种方法 #coding:utf-8 import urllib ...

  3. JAVA实现调用默认浏览器打开网页

    /** * @title 使用默认浏览器打开 * @param url 要打开的网址 */ private static void browse2(String url) throws Excepti ...

  4. 使用urllib2打开网页的三种方法

    #coding:utf-8 import urllib2 import cookielib url="http://www.baidu.com" print '方法 1' resp ...

  5. 在Silverlight中打开网页的几种方法

    HtmlPage.PopupWindow HtmlPopupWindowOptions option = new HtmlPopupWindowOptions(); option.Directorie ...

  6. WPF中打开网页的两种方法

    1.浏览器打开 Process proc = new System.Diagnostics.Process(); proc.StartInfo.FileName = "http://www. ...

  7. Python下载网页的几种方法

    get和post方式总结 get方式:以URL字串本身传递数据参数,在服务器端可以从'QUERY_STRING'这个变量中直接读取,效率较高,但缺乏安全性,也无法来处理复杂的数据(只能是字符串,比如在 ...

  8. 织梦首页、列表页调用文章body内容的两种方法

    http://blog.csdn.net/langyu1021/article/details/52261411 关于首页.列表页调用文章body内容的两种方法,具体方法如下: 第一种方法: {ded ...

  9. Openerp 中打开 URL 的三种 方法

    来自:http://shine-it.net/index.php/topic,8013.0.html 最近总结了,Openerp 中打开 URL 的三种 方法: 一.在form view 添加 < ...

随机推荐

  1. 关于open_cursors和session_cached_cursors的参数值(转)

    一.如何正确设置session_cached_cursors参数: 正确设置open_cursors和session_cached_cursors 可以减少sql解析,提高系统性能,那么,如何正确设置 ...

  2. ECCV 2018 | 旷视科技提出统一感知解析网络UPerNet,优化场景理解

    全球计算机视觉三大顶会之一 ECCV 2018(European Conference on Computer Vision)即将于 9 月 8 -14 日在德国慕尼黑拉开帷幕.届时,旷视首席科学家孙 ...

  3. BigDecimal空指针异常——个人应用

    背景: 将数据库统计的数据,封装成了两个BigDecimal,此时要将两个BigDecimal进行运算.其中有一个没有数据的话,会报null(不管null值在前在后) 先上解决: 我把数据库的数据进行 ...

  4. 求m-n之间数字的和

    unction sum(m,n){         var sum = 0;         if(m>n){                 for(var i=n; i<=m; i++ ...

  5. canvas学习笔记、小函数整理

    http://bbs.csdn.net/topics/391493648 canvas实例分享 2016-3-16 http://bbs.csdn.net/topics/390582151 html5 ...

  6. centos7防火墙使用方法

    参考网站:https://blog.csdn.net/achang21/article/details/52538049 添加开放指定端口: [root@yao bin]# firewall-cmd ...

  7. leetcode530

    /** * Definition for a binary tree node. * public class TreeNode { * public int val; * public TreeNo ...

  8. 使用.htaccess文件

    禁止对无索引文件的目录进行文件列表展示 默认情况下,当我们访问网站的某个无索引文件(如index.html,index.htm或 index.php)目录时,服务器会显示该目录的文件和子目录列表,这是 ...

  9. Linux&Unix命令

    Linux下: 系统操作 文件操作 防火墙 权限管理 压缩和解压 安装应用 用户管理 端口 PID 应用 start & shutdown 远程操作 异常 注意点: linux系统下内容大多用 ...

  10. UI5-文档-4.6-Modules

    在SAPUI5中,资源通常被称为模块.在这一步中,我们将上次练习中的警报替换为sap.m库中的适当消息Toast.所需的模块可以异步加载. Preview A message toast displa ...