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

Reading number is top 10 articles
Asp.net
ASP.NET中动态控制RDLC报表_[Asp.Net教程]
PHP爱好者来看:初学者头痛问题汇总_php资料_编程技术
让Asp.NET的DataGrid可排序、可选择、可分页_[Asp.Net教程]
学习SQL2005当中的例子_mssql学习_编程技术
在ASP.NET中为GridView添加删除提示框_[Asp.Net教程]
支付宝接口(刚完成,应该是目前最好的了)_.net资料_编程技术
Web服务器IIS6的PHP最佳配置方法_[PHP教程]
Sql,Server2005学习日记(01)_mssql学习_编程技术
在Win2003,R2上安装SQL,Server,2005(一)_[SQL,Server教程]
Reading number is top 10 pictures
这才叫绝色美女1
美洲杯宝贝的雨中风情2
迷人的靓女
湖边的风景
BingBingFan apple dew point photo gallery5
Breasts woman big set 1
俞敏洪在清华终于说了实话
Wild animals melee moment of life and death1
美女浴室写真3
男人巳快沦落成动物了
Download software ranking
Prostitutes diary
株洲本地在线棋牌游戏
Tram sex maniac 2 (H) rar bag13
Tram sex maniac 2 (H) rar bag3
Boxer's Top ten classic battle2
卡丁车单机版
Unix video tutorial11
dreamweaver8中文版
The hero
The Bermuda triangle2
aaa published in(发表于) 2013/12/6 10:25:09 Edit(编辑)
ASP.NET技巧:ASP.NET代码里访问跟踪信息_.net资料_编程技术

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

ASP.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.