Click here to Skip to main content
15,886,046 members
Articles / General Programming / Internet

Opening the Internet Browser Programmatically

Rate me:
Please Sign up or sign in to vote.
4.50/5 (2 votes)
15 Aug 2011CPOL 10K  
I use this one in C++ (has the advantage that you can use your preferred browser ;-):ShellExecute (NULL, NULL, _T("http://www.codeproject.com"), NULL, NULL, SW_SHOWNORMAL);

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
15 Aug 2011Caner Korkmaz 4 alternatives  
How to open the Internet browser from code.
Please Sign up or sign in to vote.
15 Aug 2011Kevin Marois
You're incorrect. Explorer is Windows Explorer, not Internet Explorer. Try this:System.Diagnostics.Process.Start("explorer");then this:System.Diagnostics.Process.Start("iexplore.exe", "http://www.codeproject.com");and this:System.Diagnostics.Process.Start("winword.exe",...
Please Sign up or sign in to vote.
18 Aug 2011thatraja
Given below is code for opening the Internet browser programmatically in VB 6 and VB.NET.VB 6Private Declare Function ShellExecute Lib "shell32.dll" Alias _ "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As...
Please Sign up or sign in to vote.
17 Aug 2011Michael B. Hansen
If I remember correctly, then I had some issues with the above method some years ago. It would not always work on some systems.I personally use the following method to get the EXE path to the system's default browser:public static string GetDefaultBrowser(){ string browser =...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions