opening a web page via a windows form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I found an explanation of using Process.Start to open web pages but it has
the following comments:

// url's are not considered documents. They can only be opened
// by passing them as arguments.

So how do i get the default web browser ? The example used IExplore.exe but
I don't want to try limiting to that.. I'd like to use the person's default
browser...

I guess I can peek in the registry to find what's set as default browser but
is that really necessary? There's no simpler way?

I tried opening the page directly, sorta like this for example:

Process.Start("http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.languages.csharp");

And it actually used my default browser to load the page BUT it ended up
throwing an error in my program- somehting about document not found- even
though the page loaded just fine....

any ideas?
 
MrNobody said:
I tried opening the page directly, sorta like this for example:

Process.Start("http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.languages.csharp");

And it actually used my default browser to load the page BUT it ended up
throwing an error in my program- somehting about document not found- even
though the page loaded just fine....

any ideas?


I have an application that I've written that does exactly the same
thing, with no errors. I even used the same exact URL that you are
using. Perhaps there is something up with your browser settings? Try
running it on another machine.

Lowell
 
Why not
Process.Start ( "iexplorer.exe", <<web page>> );
apart from the obvious fact you're forcing your users to use IE.
 
Back
Top