Can you start an outside process with Silverlight?

后端 未结 5 2052
有刺的猬
有刺的猬 2020-12-06 12:34

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

相关标签:
5条回答
  • 2020-12-06 13:08

    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);
    
    0 讨论(0)
  • 2020-12-06 13:09

    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.

    0 讨论(0)
  • 2020-12-06 13:10

    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

    0 讨论(0)
  • 2020-12-06 13:19

    If you are using Silverlight inside an ASPX page you could use HtmlDocument.Window.Invoke to call a JavaScript function which could in turn call a static method within your page (using WebMethod attribute)

    The article here describes the JS/ASPX bridge well.

    Kindness,

    Dan

    NB: Not sure I agree with what you are trying to do; just want to help you do it :)

    0 讨论(0)
  • 2020-12-06 13:23

    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?

    0 讨论(0)
提交回复
热议问题