将输出从控制台窗口导入Winform应用程序

将输出从控制台窗口导入Winform应用程序

问题描述:

我有一个控制台应用程序,它执行一组操作,并在完成每个操作后发出消息。当我运行控制台应用程序时,控制台窗口中的消息可能看起来像这样:

I have a console application which does a set of operations and gives out messages after completion of each operation. When I run my console app, the messages in my console window may look like this:

Checking prerequisites...
Completing prerequisites..
Performing installation...
Completing installation...
Done..!

现在我正在使用Process.StartInfo从我的一个C#Windows应用程序中执行此控制台应用程序( )。
我需要让控制台应用程序抛出的所有消息都以应用程序的Windows形式显示。

Now I'm executing this console application from one of my C# windows applications by using Process.StartInfo(). I need to get all the messages thrown by my console application to be displayed in the windows form of my application.

这可以做到吗?

谢谢。