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

Reading number is top 10 articles
目录,文件操作详谈—php_php资料_编程技术
c#编程中学习数据结构的必要性
asp.net2.0服务器控件之RadioButton控件
php session 设置问题_[PHP教程]
构建安全的Xml,Web,Service系列(三)_[Asp.Net教程]
asp.net2.0服务器控件之DropDownList控件
oracle,SQL性能优化_mssql学习_编程技术
ASP.NET技巧:全角字符转换为半角_.net资料_编程技术
随机显示数据库记录_[Asp.Net教程]
PHP和MySQL基础教程(四)_[PHP教程]
Reading number is top 10 pictures
Hunan province aizhai super-large suspension bridge open to traffic and 4 world first1
Fan bingbing black wings for platform and DanLuoWang believes beauty2
XuYing poker perspective garment debut
这只猪到底犯了什么错?
这酸爽,让人不敢相信
湖边的风景
The money of more than 100 countries and regions13
贩卖儿童者必须判死刑
西方气质的东方美女3
Poor doll, hand job was caught the currently in effect by his dad
Download software ranking
Unix video tutorial2
Adobe Flash Player(IE) 10.0.32.18 浏览器专用的FLASH插件
Unix video tutorial17
SQL2000 For 4IN1
The Bermuda triangle3
White deer villiage
传奇私服架设教程-chm
Ashlynn Video4
WebService在.NET中的实战应用教学视频 → 第2集
Tram sex maniac 2 (H) rar bag10
delv published in(发表于) 2014/1/6 8:46:52 Edit(编辑)
.net中错误日志的写入_[Asp.Net教程]

.net中错误日志的写入_[Asp.Net教程]

.net中错误日志的写入_[Asp.Net教程]

1 在.cs中执行存储过程
2
3 try
4
5 {}
6
7 catch(Exception ex)
8 {
9 cm.Connection.Close() ;
10 qiao.Value ="fail";
11 PublicUnit.SaveError(ex,this.Context,this.Request) ;
12 }
13
14
15
16 写日志的编写
17
18 public static void SaveError(Exception ex,HttpContext hc,HttpRequest hr)
19 {
20 string temp ;
21 StreamWriter sw ;
22
23 //如果存在文件
24 if(File.Exists(hr.PhysicalApplicationPath+@"\Error.txt"))
25 {
26 sw = File.AppendText(hr.PhysicalApplicationPath+@"\Error.txt") ;
27 temp = DateTime.Now.ToString() + "------------------------------------------------------------------------------------\n";
28 temp += "错误消息:" + ex.Message +"\n";
29 temp += "导致错误的应用程序或对象的名称:" + ex.Source +"\n";
30 temp += "堆栈内容:" + ex.StackTrace +"\n";
31 temp += "引发异常的方法:" + ex.TargetSite +"\n";
32 temp += "错误页面" +hr.RawUrl + "\n\n";
33
34 sw.WriteLine(temp) ;
35 sw.Close() ;
36 }
37 }
38







添加到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.