C# 在服务器上执行EXE

C# 在服务器上执行EXE,c#,asp.net,exe,C#,Asp.net,Exe,我有一个从命令行调用的exe。是否可以在服务器上执行该文件?在计算机上,如果文件位于文件夹abc中,我将转到文件夹abc,然后执行批处理。如何在下面的C代码示例中执行此操作,请确保您的权限设置正确: System.Diagnostics.Process yourProcess = new System.Diagnostics.Process(); // Set the directory yourProcess.StartInfo.WorkingDirectory = Request.M

我有一个从命令行调用的exe。是否可以在服务器上执行该文件?在计算机上,如果文件位于文件夹abc中,我将转到文件夹abc,然后执行批处理。如何在下面的C

代码示例中执行此操作,请确保您的权限设置正确:

System.Diagnostics.Process yourProcess = new System.Diagnostics.Process();

// Set the directory   
yourProcess.StartInfo.WorkingDirectory = Request.MapPath("~/"); //or wherever your file is

// Set the filename
yourProcess.StartInfo.FileName = Request.MapPath("bla.exe"); 

// Start the process    
yourProcess.Start(); 

编写下面的示例,确保权限设置正确:

System.Diagnostics.Process yourProcess = new System.Diagnostics.Process();

// Set the directory   
yourProcess.StartInfo.WorkingDirectory = Request.MapPath("~/"); //or wherever your file is

// Set the filename
yourProcess.StartInfo.FileName = Request.MapPath("bla.exe"); 

// Start the process    
yourProcess.Start(); 

在服务器端代码中,Process.StartMyExeFile当然可以执行此操作,但是,只要运行您的资料的用户帐户可以执行此操作。

在服务器端代码中,Process.StartMyExeFile当然可以执行此操作,但只要运行资料的用户帐户可以执行此操作。

是位于服务器上的文件,你是如何与它沟通的?你的问题在目前的情况下没有意义。试着更好地描述它。文件是否位于服务器上,您如何与它通信?你的问题在目前的情况下没有意义。试着更好地描述它。