如何执行从Windows窗体控制台应用程序? [英] how to execute console application from windows form?
本文介绍了如何执行从Windows窗体控制台应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从运行Windows窗体加载事件的控制台应用程序(如APP.EXE)。
我心中已经试过System.Diagnostics.Process.Start(),但它会打开APP.EXE之后,immidiately关闭它。
I want to run a console application (eg app.exe) from a windows form load event. I'v tried System.Diagnostics.Process.Start(), But after it opens app.exe, it closes it immidiately.
有没有办法,我可以运行APP.EXE,离开它打开?任何方式
Is there any way that I can run app.exe and leave it open?
推荐答案
如果你只是想在控制台窗口保持打开,可以用这样的命令来运行它:
If you are just wanting the console window to stay open, you could run it with something like this command:
System.Diagnostics.Process.Start( @"cmd.exe", @"/k c:\path\my.exe" );
这篇关于如何执行从Windows窗体控制台应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文