I saw VC debugging with debugview.Program, Very envious, After pondering that WPF can also use this stuff.
Write trace. writeline ("trace stuff") in the program. After relase,
Run debugview and perform corresponding operations to view the output information.
It is also found that the configuration file can be set to output to the TXT file.
App. config is as follows:
<? XML version = "1.0" encoding = "UTF-8"?> <Configuration> <system. Diagnostics> <trace autoflush = "true"> <listeners> <! -- <Add type = "system. diagnostics. textwritertracelistener "name =" textwriter "initializedata =" tracetext. log "/> --> <add type =" system. diagnostics. xmlwritertracelistener "name =" textwriter "initializedata =" tracexml. log "/> </listeners> </Trace> </system. diagnostics> </configuration>
Textwritertracelistener outputs the specified content to a text file
Xmlwritertracelistener outputs detailed information to a text file in XML format.
Share two articles Article :
Create a logger using the trace listener in C #
Http://www.daveoncsharp.com/2009/09/create-a-logger-using-the-trace-listener-in-csharp/
. Net tracing tutorialhttp:
// Www.codeguru.com/csharp/.net/net_debugging/tracing/article.php/c5919/