Can you have multiple .net Consoles (as in Console.Writeline)

后端 未结 4 906
無奈伤痛
無奈伤痛 2020-12-11 06:59

It would be handy during debugging to have multiple consoles (not multiple monitors, which I already have). I am imagining something like Console.WriteLine(1, String1) whic

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 07:39

    Is it possible to have 2 Windows Consoles in the same application?

    No. The Console class is just a very thin wrapper around the Win32 idea of a console. Essentially everything you see when you use cmd.exe. There is no way to create 2 of these in a single process.

    Could I have 2 Console-like windows?

    Yes. It would be possible to essentially build a very console like class in WPF or WinForms. Use that to spit out text to a command line like application.

提交回复
热议问题