how to execute console application from windows form?

后端 未结 8 918
感情败类
感情败类 2020-12-09 11:43

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 immi

8条回答
  •  温柔的废话
    2020-12-09 11:46

    If app.exe does nothing, or finishes its work quickly (i.e. simply prints "Hello World" and returns), it will behave the way you just explained. If you want app.exe to stay open after its work is done, put some sort of completion message followed by Console.ReadKey(); in the console application.

提交回复
热议问题