Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / programming / Internet

Opening the Internet Browser Programmatically

5.00/5 (2 votes)
15 Aug 2011CPOL 47.6K  
How to open the Internet browser from code.

If you type something like:


explorer http://www.codeproject.com

in an Explorer window or Command Prompt, then the Internet browser you use will open :). You can use it like this in code:
C++
#include <stdlib.h>
main()
{
    system("explorer http://www.codeproject.com");
}

in C++. Or:


C#
System.Diagnostics.Process.Start("explorer","http://www.codeproject.com");

in C# :)

License

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