c# - 你能有多个 .net 控制台吗(如在 Console.Writeline 中)

标签 c# vb.net

在调试期间拥有多个控制台(不是多个监视器,我已经拥有)会很方便。我在想象像 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.

[ http://msdn.microsoft.com/en-us/library/ms681944(VS.85).aspx](http://msdn.microsoft.com/en-us/library/ms681944(VS.85).aspx)

相反,您可以使用 WinForms 或 WPF 创建多个“控制台”窗口,并编写一个简单的 WriteLine 方法将文本附加到文本框或类似内容。

另一种选择是打开一个日志文件,并将其用作您的第二个“控制台”。

关于c# - 你能有多个 .net 控制台吗(如在 Console.Writeline 中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/671163/

相关文章:

c# - Nhibernate Criteria 进行动态查询并获取行数

c# - 我能找到 .NET 4.0 的 WPF 图表控件教程吗

.net - String.Join 方法忽略空字符串?

c# - 如何使用 SqlDataSource 处理异常

c# - 创建一个新的 MailAddress 会产生 "The specified string is not in the form required for an e-mail address",尽管它的格式是正确的

c# - 如何使用 Reactive 限制消费顺序?

c# - Visual Studio 2008 : Unit-Test methods in generic classes are not detected properly

vb.net - < .... > 在 VB.NET 中做什么?

.net - 如果变量名出现在 2 个 dll 的 2 个模块中,VB.NET 如何知道要设置哪个变量

来自参数或变量的 SQL WHERE IN