How to set the default browser home page (IE) with C#?

吃可爱长大的小学妹 提交于 2019-12-19 11:15:11

问题


How can I programmatically change my browser's default home page with C#?


回答1:


Set it in this registry setting:

HKCU\Software\Microsoft\Internet Explorer\Main\Start Page



回答2:


See this, which is not in C#, but you should be able to work out the registry stuff in C# pretty easily.

http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1108.mspx

Please don't arrange for this code to run on my machine!




回答3:


I'd hit the registry:

For User Based Changes

HKCU\Software\Clients\StartMenuInternet

Check the keys below this key for the list of browsers on the system. Set the reg_sz value to the name of the key of the browser that you want to set as default.

For Machine-Wide Changes

Check HKLM\Software\Clients\StartMenuInternet for the system

Help with C# Registry Modifications

see here: http://www.csharphelp.com/archives2/archive392.html



来源:https://stackoverflow.com/questions/332486/how-to-set-the-default-browser-home-page-ie-with-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!