在调试期间拥有多个控制台(不是多个监视器,我已经拥有)会很方便。我在想象像 Console.WriteLine(1, String1) 这样的东西,它将 String1 发送到一个控制台窗口 1,而 Console.WriteLine(2, String2) 将 String2 发送到控制台窗口 2。
最佳答案
没有
A process can be associated with only one console, so the AllocConsole function fails if the calling process already has a console. A process can use the FreeConsole function to detach itself from its current console, then it can call AllocConsole to create a new console or AttachConsole to attach to another console.
相反,您可以使用 WinForms 或 WPF 创建多个“控制台”窗口,并编写一个简单的 WriteLine
方法将文本附加到文本框或类似内容。
另一种选择是打开一个日志文件,并将其用作您的第二个“控制台”。
关于c# - 你能有多个 .net 控制台吗(如在 Console.Writeline 中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/671163/