Dim log as System.IO.TextWrite
log=System.IO.File.CreateText("D:/log.txt")
Dim logListener as new System.Diagnostics.TextWriterTraceListener(log)
System.Diagnostics.Trace.AutoFlush=true
System.Diagnostics.Trace.Listeners.add(logListener)
System.Diagnostics.Trace.Write("Sorry,there are some thing wrong in your Application! Please check it!")
System.Diagnostics.Trace.Close()
log.Close()
原文链接:https://www.f2er.com/vb/261572.html