社区,
这是使用 Visual Studio 2012 (Express) for Desktop 的另一个解决方案。基本上,您将需要导入系统诊断并包含特定的代码行。见下文:
Imports System.Diagnostics
'Write Your Code Here
Trace.Listeners.Add(New TextWriterTraceListener(Console.Out))
Debug.Print(Today) 'This will print the date in "Short" form | Carriage Return
Debug.Write(Today) 'This will print the date in "Long" form
Trace.Write(Today) 'This will print the date in "Long" form
就是这样。第一行代码是必要的,这样 Visual Studio 才能识别 Debug & Trace 类。需要第二行代码,以便窗口实际显示您需要的内容。最后三行代码基本上做同样的事情。
还有一件事,确保您在输出窗口的“调试”页面中以查看打印输出!
最后一件事,如果您是新手 [像我一样],如果您希望 Visual Studio在输出窗口中显示“Debug.Print” ,请确保按F5而不是 CTRL+F5。
PS。有一种方法可以让输出出现在即时窗口中;但我改变了我的设置,现在它不会出现。所以,如果你喜欢它,你可以修改选项,最终你会得到它。