Okay I'm having a brain fart here. This should be simple, but I'm missing something.
I've got a win form and I'm trying to launch a web page when I click a button. The code for the button is here:
private void button2_Click(object sender, EventArgs e)
{
try
{
System.Diagnostics.Process.Start("http://www.google.com");
}
catch (Win32Exception ex)
{
Console.WriteLine(ex.Message);
lblError.Text = ex.Message;
}
}
When I run this on my computer, it works fine. On other computers, it only works if you have a browser already open. If you don't have a browser open, it opens the browser then just hangs. What gives?
I've also tried
`System.Diagnostics.Process.Start("IExplore.exe", "http://www.google.com");`
ignoring the default browser (something I'd like to avoid but if it works, it works). I get the same result.
Thanks for your help.
EDIT: I'm also open to other methods of launching a web page with a button if any of you can think of one.