簡體   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