简体   繁体   English

如何在Windows中更改默认浏览器?

[英]How to change the default browser in Windows?

I have created a simple browser in c# for a couple family members. 我用c#为几个家庭成员创建了一个简单的浏览器。 I want to set it as the default browser either from an installer or from the program. 我想通过安装程序或程序将其设置为默认浏览器。 I want to do the same thing as Chrome or Firefox does when it asks you if you want to set it as default. 当您询问是否要将其设置为默认值时,我想做与Chrome或Firefox相同的操作。 I can set up command line processing, all I need to know is how to how to set the default browser. 我可以设置命令行处理,所有我需要知道的是如何设置默认浏览器。

Perhaps http://www.windowsitpro.com/article/configuration/how-can-i-configure-the-default-internet-browser- has the information you want. 也许http://www.windowsitpro.com/article/configuration/how-can-i-configure-the-default-internet-browser-具有所需的信息。 So you can check these entries at startup and they are not what you want you can set them! 因此,您可以在启动时检查这些条目,而这些不是您想要的,可以对其进行设置!

Having created your own browser I assume you are able to use the Microsoft.Win32.Registry and translate this to code on your own. 创建您自己的浏览器后,我假设您可以使用Microsoft.Win32.Registry并将其翻译为自己的代码。

Yes, you can change it using registry entries as @Mattias told you. 是的,您可以按照@Mattias的说明使用注册表项进行更改。 But it is a really bad idea , if you do that you are hurting user experience. 但这是一个非常糟糕的主意,如果这样做会损害用户体验。

In a corporate environment, domain policies already have support to make this things. 在公司环境中,域策略已经支持执行此操作。

You also can establish local (nor domain) policies using GPedit.msc. 您也可以使用GPedit.msc建立本地(非域)策略。 Change registry entries or use gpedit.msc , any way don't hurt UX even in your family this is awfull for affected people. 更改注册表项或使用gpedit.msc,即使在您的家庭中,也不会损害UX,这对受影响的人来说实在是太糟糕了。 Anybody must be free tho choose the browser they want, even a bad browser. 任何人都必须自由选择他们想要的浏览器,甚至是糟糕的浏览器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM