繁体   English   中英

如何配置Debug.WriteLine输出文件?

[英]How to configure Debug.WriteLine output file?

System.Diagnostics.Debug.WriteLine用于跟踪。

Funilly文件C:\\Users\\Public\\Documents\\UserNameFromProgramContext\\ProgramName.asserts是在我的机器上创建的,但不是在另一个开发人员的文件上创建的。

我只想在VS的输出窗口中输出Debug.WriteLine

在哪里可以配置Debug.WriteLine写入的位置?

简单:

Debug.Listeners.Add(new TextWriterTraceListener("c:\\temp\\test.txt"));
Debug.AutoFlush = true;
Debug.WriteLine("test");

所以只需使用Listeners集合来操作调试数据的写入位置

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM