Open a new console with every new Thread in C#?

半世苍凉 提交于 2019-11-28 13:34:34

A process can be associated with only one console

http://msdn.microsoft.com/en-us/library/windows/desktop/ms681944(v=vs.85).aspx

It's not difficult to work around this limitation.

The code that you want to run as a separate thread with its own console window, simply code that as a separate console application, passing parameters as required on the command line.

Then run separate instances of this code using Start() inside your main application.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!