满意答案
sjfbdsjfsf
推荐于 2017.12.15
采纳率:48% 等级:10
已帮助:774人
1. “工具”→“Internet选项”,在打开的窗口中选择“程序”选项卡,然后勾选“检查Internet Explorer是否为默认浏览器”,最后单击“确定”。
这样就可以了啊。
为什么要在代码里面修改呢?
2. C#里面是可以的修改的
///
/// 恢复IE为默认浏览器
///
///
public static bool ResetIEDefaultBrowser()
{
string mainKey = @"http\shell\open\command";
string nameKey = @"http\shell\open\ddeexec\Application";
string IEPath = @"C:\Program Files\Internet Explorer\iexplore.exe";
bool result = false;
try
{
string value = string.Format("\"{0}\" -- \"%1\"", IEPath);
RegistryKey regKey = Registry.ClassesRoot.OpenSubKey(mainKey, true);
regKey.SetValue("", value);
regKey.Close();
regKey = Registry.ClassesRoot.OpenSubKey(nameKey, true);
regKey.SetValue("", "IExplore");
regKey.Close();
result = true;
}
catch
{
}
return result;
00分享举报