1. “工具”→“Internet选项”,在打开的窗口中选择“程序”选项卡,然后勾选“检查Internet Explorer是否为默认浏览器”,最后单击“确定”。
这样就可以了啊。
为什么要在代码里面修改呢?
2. C#里面是可以的修改的
/// summary
/// 恢复IE为默认浏览器
/// /summary
/// returns/returns
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;
取消
评论