【Winform】Webservice调用服务器端EXE
1权限的话给EXE文件加上aspnet账号就没问题了。->失败
2网页测试Console是否通过 ->失败
3 <identity impersonate="true"/> ->失败
4.异步调用
异步WebService调用
http://www.cnblogs.com/jigee/archive/2007/01/11/617375.html
C# 中启动进程的三种方法
http://www.cnblogs.com/xiongeee/archive/2007/02/07/643647.html
异步WebService调用
http://www.cnblogs.com/thx-bj/archive/2008/04/24/1168971.html
5.测试OutTxt.exe ->成功
6.测试向OutTxt.exe传参数 ->成功
6.测试OutTxt.exe等待1分钟 ->成功
Dim myP As New System.Diagnostics.Process
myP.StartInfo.FileName = appPath & "OutTxt.exe"
myP.StartInfo.UseShellExecute = False
myP.StartInfo.RedirectStandardOutput = True
myP.StartInfo.Arguments = "1"
myP.Start()
myP.WaitForExit()
myP.StartInfo.FileName = appPath & "OutTxt.exe"
myP.StartInfo.UseShellExecute = False
myP.StartInfo.RedirectStandardOutput = True
myP.StartInfo.Arguments = "1"
myP.Start()
myP.WaitForExit()
Dim info As New System.Diagnostics.ProcessStartInfo
info.FileName = "cmd.exe"
info.UseShellExecute = False
info.RedirectStandardInput = True
info.RedirectStandardOutput = True
info.RedirectStandardError = True
info.CreateNoWindow = True
Dim cmdStr As String
cmdStr = "OutTxt.exe 1"
Dim proc As Diagnostics.Process = System.Diagnostics.Process.Start(info)
proc.StandardInput.WriteLine(cmdStr)
proc.StandardInput.WriteLine("exit")
info.FileName = "cmd.exe"
info.UseShellExecute = False
info.RedirectStandardInput = True
info.RedirectStandardOutput = True
info.RedirectStandardError = True
info.CreateNoWindow = True
Dim cmdStr As String
cmdStr = "OutTxt.exe 1"
Dim proc As Diagnostics.Process = System.Diagnostics.Process.Start(info)
proc.StandardInput.WriteLine(cmdStr)
proc.StandardInput.WriteLine("exit")
本作品采用 知识共享署名-非商业性使用 2.5 中国大陆许可协议进行许可。 |