English 中文(简体)
我可以运行任何. exe文件通过网络服务如何
原标题:
  • 时间:2009-04-06 08:07:06
  •  标签:

如何我可以运行任何. exe文件通过网络服务构建?

提前感谢年代

问题回答

看看< a href = " http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx " rel = " nofollow noreferrer " > System.Diagnostics。< / >类过程。

你可以试试这个。

using System.Diagnostics;

class Program
{
    static void Main()
    {
        Process.Start("example.exe");
    }
}

我认为你希望能够发送一个exe文件到你的网络服务,比执行?

我建议以下序列。

  1. Recieve the file and write it to a temporary directory.
    • Optionally scan the file with a anti-virus scanner. (Depending on the level of trust of your webservice)
    • Use Process.Start to start the temporary file and wait for it to stop running (perhaps supply a parameter to wait for exit or not)
    • Delete the temporary file.
    • Report back the result of the execution (if it s console application you could even report back the text printed by the application).




相关问题
热门标签