如何将将c程序的输出传递给以窗口(GUI)形式打开的程序的过程自动化 [英] How can I automize the process of passing output of my c program to a program which opens in the form of a window ( GUI )
本文介绍了如何将将c程序的输出传递给以窗口(GUI)形式打开的程序的过程自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
团队,
您能否帮我提供一些提示,让我了解如何自动将c程序的输出传递给以窗口(GUI)形式打开的程序的过程.
赞赏您的回答. Process.Start
.
在此过程中,您需要为开发的某些流分配StandardInput
(如果需要,请使用StandardError
)属性,以将C程序输出重定向到程序.您需要开发一个特殊的流类,用于获取流数据并将其发送到您的UI以便在某些控件上进行呈现.
有关更多信息,请参见System.Diagnostics.Process
: http://msdn.microsoft.com/en -us/library/system.diagnostics.process.aspx [ 解决方案
Assuming you C program outputs text data to console and you cannot or don''t want to modify it, you need to start a process usingProcess.Start
.
In the process, you need to assignStandardInput
(and if you need,StandardError
) properties to some stream you develop to redirect you C program output to your program. You need to develop a special stream class used to get stream data and send it to your UI for presentation on some control.
Please seeSystem.Diagnostics.Process
for more information: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[^].
(For example, this technique is the standard way to implement compilation using console-mode external compiler, something that is done by Visual Studio when you compile your project. You can achieve exact same behavior.)
—SA
这篇关于如何将将c程序的输出传递给以窗口(GUI)形式打开的程序的过程自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文