Jonas Mohr Pedersen
Jonas Mohr Pedersen

Reputation: 555

Opening url in specific browser

I'm developing a program for my work, but am encountering a problem.

The purpose of the program, is to open different websites in a chosen browser on the click of a button. In the software, i give the user the abillity to choose whether to use chrome or IE to open the websites.

I've tried using System.process.Start("URL") to open websites. This works, but it opens the url in the browser which is set as default in windows.

I however, want the software to open the URLs in a user-chosen browser, by using the file path to the browser.exe - or any other way to do it.

Upvotes: 1

Views: 8659

Answers (2)

amin
amin

Reputation: 1244

Process.Start("C:\Program Files\Mozilla Firefox\firefox.exe", "http://www.somewebsite.com/");

see also :

here

And Here

Upvotes: 4

Derek
Derek

Reputation: 8763

Then you probably need the full path to the executable(s) to use with Process.Start.

Or they need to be on your path:

System.Diagnostics.Process.Start( "Firefox.exe", url );

Upvotes: 4

Related Questions