Reputation: 2715
how can i get the default homepage from the default browser (IE, firefox,...) in C#.
Upvotes: 1
Views: 1698
Reputation: 147370
There's no universal way to do it. First, you'd need to find the default browser. The path to the EXE for the default browser is always stored in the registry key:
HKCR\HTTP\shell\open\command
Once you know the browser, things are a lot more open-ended. Internet Explorer, for example, stores the home page URL in the following registry key:
HKCU\Software\Microsoft\Internet Explorer\Main\Start Page
In general however, browser can store the home page in any way they like (possibly in the registry but, possibly in a config file).
Note: If you're not familiar with accessing the Windows registry in .NET/C#, the MSDN page should provide all the info you need.
Upvotes: 3