Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you start an outside process with Silverlight?

The System.Diagnostics assembly is part of the Silverlight CLR framework, but it only includes classes related to debugging, the Process class is not available. Is there any other way to start an outside process from a Silverlight application?

like image 665
Crackerjack Avatar asked Apr 06 '10 15:04

Crackerjack


4 Answers

Yes, you can in Silverlight 4 (in out-of-browser with elevated full trust), example:

dynamic cmd = AutomationFactory.CreateObject("WScript.Shell");
cmd.Run("calc.exe", 1, true);
like image 195
Alexander Zwitbaum Avatar answered Nov 14 '22 12:11

Alexander Zwitbaum


Using an elevated trust out of browser app (shall we coin ETOOB or OOBET for short) Silverlight 4 application you may be able to start a new app in a new process if it is a COM Automation server. For example:-

dynamic excel = ComAutomationFactory.CreateObject("Excel.Application"); 

Should fire up Excel in its own procress.

like image 37
AnthonyWJones Avatar answered Nov 14 '22 13:11

AnthonyWJones


There is no short answers, but there is a complex one...

If you are runnign SL4 Out-Of-Browser, and you indicated that you are ok running elivated (which really mean SL doesnt run in IE-Protected mode, but rather as standard app...) there is a way for you by using WMI to basically do ANY THING you want to. This blog post will help you - http://justinangel.net/CuttingEdgeSilverlight4ComFeatures . Just keep in mind, this is high end fancy coding, so watch yourself ;)

There are two great sample chapters on Windows Phone and Silverlight for Windows Phone on the LearningWindosPhone.com site. There is great Windows Phone Trainng material , and dont forget the Windows Phone Develoeprs Blog

like image 25
deborah-digges Avatar answered Nov 14 '22 11:11

deborah-digges


If you are running your application either in the browser or as a standard out of browser application, being able to start another process would break the Silverlight model, allowing your application access to the machine outside the browser sandbox.

A full trust application will be able to do this.

Why do you want to start another process?

like image 2
ChrisF Avatar answered Nov 14 '22 13:11

ChrisF