MGR
MGR

Reputation: 167

Silverlight -- Open a webpage with chrome

I want to open a website with chrome browser from silverlight application which running in internet explorer.

I can do that with below code

htmlpage.window.navigate(new uri("myuri","blank"));

But website opening in IE because of our default webbrowser is IE.

How can i open this webpage with chrome when i clicked a button

Thanks inadvance

Upvotes: 3

Views: 706

Answers (1)

Arnaud Develay
Arnaud Develay

Reputation: 3970

Using Silverlight 5, you will need to activate the following setting: "Require elevated trust when running in-browser". Then you can launch any executable using the Shell. Here is an example with Chrome, the argument should be your uri.

if (App.Current.HasElevatedPermissions)
{
    dynamic shell = AutomationFactory.CreateObject("WScript.Shell");
    exeFile.Run(@"""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"" myuri.com");
}

Upvotes: 2

Related Questions