2014-01-12 43 views

回答

0

你的问题实际上包括了答案的一部分。这两个进程无论他们在中写入哪种语言,都必须以客户端 - 服务器方式进行数据交换。因此,C++进程必须充当服务器和ASP.NET作为从服务器请求数据的客户端。

因此,你可以建立一个web service,无论是SOAP或使用C++和参考REST通过你的ASP.NET进程这个Web服务请求从C++服务器数据。 Here you could find a tutorial on how to build a web service using C++Here you could find a .NET tutorial on web services

另外,更简单,但结构更少方法将使用类似保险库,可能是文件或数据库的东西。结果将在跳马写反正(即使他们并没有询问就随时ASP.NET进程会找回它们。

希望我帮助!

2

您可以在文件系统中执行一个进程,而不必使用写入的语言。 想要这样:

ProcessStartInfo processInfo = new ProcessStartInfo("C++App.exe", "command line arguments like /page getdata.aspx ... "); 
processInfo.ErrorDialog = false; 
processInfo.UseShellExecute = false; 
processInfo.RedirectStandardOutput = true; 
processInfo.RedirectStandardError = true; 

Process proc = Process.Start(processInfo); 

proc.ErrorDataReceived += (sender, errorLine) => { if (errorLine.Data != null) Trace.WriteLine(errorLine.Data); }; 
proc.OutputDataReceived += (sender, outputLine) => { if (outputLine.Data != null) Trace.WriteLine(outputLine.Data); }; 
proc.BeginErrorReadLine(); 
proc.BeginOutputReadLine(); 

proc.WaitForExit(); 

问候。

+0

感谢ü非常感谢。我会尝试。 ......... – Jaithera

相关问题