Sam*_*yon 7

默认浏览器将保存为Windows注册表项中的条目.这些值是在这样的协议基础上保存的

HKEY_CLASSES_ROOT\[协议] \壳\开放\命令

协议可以是http,https等.关于如何访问/修改C#中的注册表值,你可以看看这篇文章


Cer*_*rus 5

我认为你需要修改至少两个RegistryKeys并设置替代浏览器的路径:

HKEY_CLASSES_ROOT\http\shell\open\command
HKEY_CLASSES_ROOT\htmlfile\shell\open\command
Run Code Online (Sandbox Code Playgroud)

另一种方法是在Shell密钥下创建一个附加条目,并将其设置为默认操作:

[HKEY_CLASSES_ROOT\http\shell]
(default) set to OpenWithMyBrowser

[HKEY_CLASSES_ROOT\http\shell\OpenWithMyBrowser\command]
(default) set to "MyBrowser.exe"
Run Code Online (Sandbox Code Playgroud)