Vb中把追踪的异常信息写的log文件

前端之家收集整理的这篇文章主要介绍了Vb中把追踪的异常信息写的log文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

猜你在找的VB相关文章