这个问题困扰我好久了,为什么用Console.WriteLine()总是看不到输出?
难道winform程序就不能用Console的输出,经过一番百度,貌似真的是这样
那难道就只能在程序上搞个textbox来输出吗?又或者只能是输出到文本?
网上某文提到了以下解决方法(红色为我加的):
1.debug只在[debug模式下才执行](运行按钮后面的下拉框可选)
这个我没找到~~~~~
2.debug提供了许多调试指令,如断言
System.Diagnostics.Debug.Assert(false,"信息");
将出现一个对话框
调用前声明:
using System.Diagnostics;
调用方式:
Debug.WriteLine();
Debug.WriteLineIf();//两个参数,当第一个参数为true时,第二个参数的调试信息会显示出来。
Trace.WriteLine();//Release版本,当然Debug中也可以显示
Trace.WriteLineIf();//同上
3.debug可以自定义监听器
System.Diagnostics.TextWriterTraceListener t=new System.Diagnostics.TextWriterTraceListener(@"c:\a.txt");
System.Diagnostics.Debug.Listeners.Add(t);
System.Diagn