How do I open a web browser from a .NET Program? Process.Start() isn't working?
- by Scott Whitlock
I have a URL and I want to launch it in the default browser. I've tried two methods:
Process.Start("http://stackoverflow.com");
... and the one detailed in this other question using ShellExecute.
In both cases I get the error: Windows cannot find 'http://stackoverflow.com'. Make sure you typed the name correctly, and then try again.
It shouldn't be trying to open it as a file though... from what I understand, it should recognize it as a URL and open it in the default browser. What am I missing?
By the way: OS = Vista, and .NET = 3.5
EDIT:
According to this MS KB article, since Process.Start sets the UseShellExecute by default, it should launch the default browser.