<%@ page language="vb"%> <script runat="server"> protected sub page_load(byval sender as object, byval e as system.eventargs) addhandler trace.tracefinished, addressof ontracefinished trace.write("自定义类别", "自定义跟踪消息") end sub private sub ontracefinished(byval sender as object, byval e as tracecontexteventargs) dim tcr as tracecontextrecord for each tcr in e.tracerecords response.write(string.format(" <li>跟踪类别:{0} 跟踪消息:{1}", tcr.category, tcr.message)) next end sub