65.9K
CodeProject is changing. Read more.
Home

Opening the Internet Browser Programmatically

starIconstarIconstarIconstarIconstarIcon

5.00/5 (2 votes)

Aug 15, 2011

CPOL
viewsIcon

47561

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:
#include <stdlib.h>
main()
{
    system("explorer http://www.codeproject.com");
}

in C++. Or:

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

in C# :)