using System.Text.RegularExpressions;
using Microsoft.Win32;
RegistryKey key = Registry.ClassesRoot.OpenSubKey(@"http\shell\open\command\");
string s = key.GetValue("").ToString();
Regex reg = new Regex("\"([^\"]+)\"");
MatchCollection matchs = reg.Matches(s);
string filename="";
if (matchs.Count > 0)
{
filename = matchs[0].Groups[1].Value;
System.Diagnostics.Process.Start(filename, AppUtils.configSetting.WebUri);
}
通过注册表取得默认浏览器的路径,然后用进程打开即可。
本文介绍如何通过注册表获取默认浏览器的路径,并使用C#代码实现将其作为参数启动进程。
1332

被折叠的 条评论
为什么被折叠?



