Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在C中从Web服务调用exe#_C#_Asp.net_Web Services_Iis 7 - Fatal编程技术网

C# 如何在C中从Web服务调用exe#

C# 如何在C中从Web服务调用exe#,c#,asp.net,web-services,iis-7,C#,Asp.net,Web Services,Iis 7,问题是,我们需要从大型机终端打印一些文档,但我们只能从大型机调用web服务。我们有一个.exe应用程序,我们希望Web服务调用它并传递相应的参数。当我们执行.exe时,它工作得很好,但是当我们从web服务中调用它时,什么也没有发生 这是调用exe的示例代码: System.Diagnostics.ProcessStartInfo startInfo; startInfo = new System.Diagnostics.ProcessStartInfo(@"C:\Inetpub\wwwroot\

问题是,我们需要从大型机终端打印一些文档,但我们只能从大型机调用web服务。我们有一个.exe应用程序,我们希望Web服务调用它并传递相应的参数。当我们执行.exe时,它工作得很好,但是当我们从web服务中调用它时,什么也没有发生

这是调用exe的示例代码:

System.Diagnostics.ProcessStartInfo startInfo;
startInfo = new System.Diagnostics.ProcessStartInfo(@"C:\Inetpub\wwwroot\PrintBarCode.exe");
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = false;
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

using (System.Diagnostics.Process exeProcess = System.Diagnostics.Process.Start(startInfo))
{
    exeProcess.WaitForExit();
}

胡乱猜测,您很可能遇到权限问题


请记住,Web服务可能在不同的凭据上运行。

您是否尝试过在Web服务之外对代码进行单元测试以确保其工作正常?是否尝试过在其中放置断点以查看发生了什么?可能是权限问题?请记住,Web服务可能运行在不同的证书上。答案很多。您可以从这里开始-“”。