using process.start to open a web page

B

bill

i'm using VS2005, VB.NET windows forms application
when I try to open a web page using process.start, i get an error:
"application not found"

I'm using this syntax:

System.Diagnostics.Process.Start("http://www.microsoft.com/")

It works if I do it like this (thank you HKW), but what if the user doesn't
use IE, but uses some other browser?

Dim psi As New ProcessStartInfo()
With psi
.FileName = "iexplore"
.Arguments = "-new http://dotnet.mvps.org/"
End With
Process.Start(psi)


Thanks
Bill
 
K

kimiraikkonen

i'm using VS2005, VB.NET windows forms application
when I try to open a web page using process.start, i get an error:
"application not found"

I'm using this syntax:

System.Diagnostics.Process.Start("http://www.microsoft.com/")

It works if I do it like this (thank you HKW), but what if the user doesn't
use IE, but uses some other browser?

Dim psi As New ProcessStartInfo()
With psi
.FileName = "iexplore"
.Arguments = "-newhttp://dotnet.mvps.org/"
End With
Process.Start(psi)

Thanks
Bill

For instance, I changed default browser to Firefox from IE and the
syntax

System.Diagnostics.Process.Start("http://www.microsoft.com/")

worked well.(It was opened in IE when IE was default, it was opened in
Firefox when Firefox was default).

What's the exact problem?

or do you want your users to open link in Firefox explictly:
System.Diagnostics.Process.Start( _
"C:\Program Files\Mozilla Firefox\firefox.exe", _
"http://www.microsoft.com")

Hope this helps,

Onur Güzel
 
B

bill

Kimi -

I saw that Heikki and Mark stole the front row from you today at Silverstone
- good luck tomorrow, though.

when I use
System.Diagnostics.Process.Start("http://www.microsoft.com/")

I get an error:

"application not found"
 
K

kimiraikkonen

Kimi -

I saw that Heikki and Mark stole the front row from you today at Silverstone
- good luck tomorrow, though.

when I use
System.Diagnostics.Process.Start("http://www.microsoft.com/")

I get an error:

"application not found"

Bill,
Though it's just my nickname, thanks for your goodwill :)

However, i can't reproduce the problem you mentioned on XP, anyway
would you also try this:

Shell("explorer.exe http://www.microsoft.com", _
AppWinStyle.NormalFocus)

Hope this helps,

Onur Güzel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top