admin 管理员组

文章数量: 887021

using System;

using System.Diagnostics;

using System.IO;

using System.Windows.Forms;

using Microsoft.Win32;

namespace WindowsFormsApplication1

{

public class BrowserHelper

{

/// <summary>

/// 调用系统浏览器打开网页

/// http://m.jb51/article/44622.htm

/// http://www.2cto/kf/201412/365633.html

/// </summary>

/// <param name="url">打开网页的链接</param>

public static void OpenBrowserUrl(string url)

{

try

{

// 64位注册表路径

var openKey = @"SOFTWARE\Wow6432Node\Google\Chrome";

if (IntPtr.Size == 4)

{

// 32位注册表路径

openKey = @"SOFTWARE\Google\Chrome";

}

RegistryKey appPath = Registry.LocalMachine.OpenSubKey(openKey);

// 谷歌浏览器就用谷歌打开,没找到就用系统默认的浏览器

// 谷歌卸

本文标签: 浏览器 页面