All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
支付宝Payto接口的c#.net实现_[Asp.Net教程]
详细阐述PHP环境下如何将gbk编码转成utf8格式_php资料_编程技术
ASP.NET,2.0页面性能的考虑_[Asp.Net教程]
php和asp对象的等价关系_[PHP教程]
ASP.NET,2.0页面性能的考虑_.net资料_编程技术
用PHP+MySQL搭建聊天室_php资料_编程技术
如何将应用程序由ASP.NET,1.1移植到ASP.NET,2.0_.net资料_编程技术
PHP实例:从数组里筛选出重复的数据_php资料_编程技术
使用Forms,Authentication实现用户注册、登录,(二)用户注册与登录_[Asp.Net教程]
ASP.NET中的File类和Directory类的相关知识_[Asp.Net教程]
Reading number is top 10 pictures
Ashlynn Brooke show proud chest measurement1
The money of more than 100 countries and regions3
29 the belle stars after bath figure1
2012 national geographic daily picture2
俞敏洪在清华终于说了实话
Summer is most suitable for young people to travel in China2
西游四格漫画(二)
The goddess of the single reason2
China's first snake village1
鸡蛋的新玩法
Download software ranking
Kung.Fu.Panda.2
Tram sex maniac 2 (H) rar bag5
Unix video tutorial4
I for your crazy
Jinling thirteen stock
Unix video tutorial11
jBuilder2006
WebService在.NET中的实战应用教学视频 → 第4集
天龙八部最新服务端
JSP+Ajax Web development typical examples
aaa published in(发表于) 2013/12/6 10:39:31 Edit(编辑)
在ASP.NET代码里访问跟踪信息_.net资料_编程技术

在ASP.NET代码里访问跟踪信息_.net资料_编程技术

在ASP.NET代码里访问跟踪信息_.net资料_编程技术-数科优化网
  ASP.NET 2.0允许通过代码在TraceFinished事件里来访问每个请求的跟踪信息。TraceFinished事件是由TraceContext对象引发,用于在收集完所有请求信息后公开跟踪消息。可以利用此事件对跟踪信息进行不同的输出。以下代码就是用程序输出跟踪信息。

  C#:


<%@ Page Language="C#" %>
<SCRIPT runat="server">
protected void Page_Load(object sender, System.EventArgs e)
{
 Trace.TraceFinished += new TraceContextEventHandler(OnTraceFinished);
 Trace.Write("自定义类别", "自定义跟踪消息");
}
private void OnTraceFinished(object sender, TraceContextEventArgs e)
{
 foreach (TraceContextRecord tcr in e.TraceRecords)
 {
  Response.Write(string.Format(" <li>跟踪类别:{0} 跟踪消息:{1}", tcr.Category, tcr.Message));
 }
}
</SCRIPT>

  VB.NET:


<%@ 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

</SCRIPT>




添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.