By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,236 Members | 1,809 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,236 IT Pros & Developers. It's quick & easy.

opening a web page via a windows form

P: n/a
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?
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
MrNobody wrote:
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
Nov 16 '05 #2

P: n/a
Well, I found a web site that suggested another way to do this, and it works
fine for me so I'll use it.

It sugegsts you open a web page using ShowHelp, like this:

elp.ShowHelp(Form.ActiveForm,
"http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.languages. csharp");

This also solves a problem where using Process.Start can sometimes open the
browser behind your application

"Lowell Heddings" wrote:
MrNobody wrote:
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

Nov 16 '05 #3

P: n/a

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

"MrNobody" <Mr******@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com...
Well, I found a web site that suggested another way to do this, and it
works
fine for me so I'll use it.

It sugegsts you open a web page using ShowHelp, like this:

elp.ShowHelp(Form.ActiveForm,
"http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.languages. csharp");

This also solves a problem where using Process.Start can sometimes open
the
browser behind your application

"Lowell Heddings" wrote:
MrNobody wrote:
> 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

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.