从运行Windows窗体控制台应用程序窗体、控制台、应用程序、Windows

2023-09-05 23:41:52 作者:深情迎风散

我有一个Windows控制台应用程序(即接受参数)和运行的进程。 我想知道是否有任何方式从一个窗口形式的按钮单击事件中运行这个程序。我想一个参数传递给它。

I have a windows console app (that accepts parameters) and runs a process. I was wondering if there was any way to run this app from within a windows form button click event. I would like to pass an argument to it as well.

感谢

推荐答案

只需使用 System.Diagnostics.Process.Start 的与路径控制台应用程序,而这些参数作为第二个参数。

Just use System.Diagnostics.Process.Start with the path to the console application, and the parameters as the second argument.