问题
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