我爱Aspx >> Asp.Net >> 初学asp.net应该记住的东西/// </summary>
public static void WriteTrace(String message)
{
WriteLog(TraceLevel.Verbose, message);
}
/// <summary>
/// 格式化记录到事件日志的文本信息格式
/// <param name="ex">需要格式化的异常对象</param>
/// <param name="catchInfo">异常信息标题字符串.</param>
/// <retvalue>
/// <para>格式后的异常信息字符串,包括异常内容和跟踪堆栈.</para>
/// </retvalue>
/// </summary>
public static String FormatException(Exception ex, String catchInfo)
{
StringBuilder strBuilder = new StringBuilder();
if (catchInfo != String.Empty)
{
strBuilder.Append(catchInfo).Append("\r\n");
}
strBuilder.Append(ex.Message).Append("\r\n").Append(ex.StackTrace);
return strBuilder.ToString();
}
/// <summary>
/// 实际事件日志写入方法
/// <param name="level">要记录信息的级别(error,warning,info,trace).</param>
/// <param name="messageText">要记录的文本.</param>
/// </summary>
private static void WriteLog(TraceLevel level, String messageText)
{
try
{
EventLogEntryType LogEntryType;
switch (level)
{
case TraceLevel.Error:
LogEntryType = EventLogEntryType.Error;
break;
case TraceLevel.Warning:
LogEntryType = EventLogEntryType.Warning;
break;
case TraceLevel.Info:
LogEntryType = EventLogEntryType.Information;
Ҷƪл˵?
从COM组件调用.NET组件编程实战[04-21]
缓存 ASP.NET 页的某些部分[04-21]
c#教程第一讲 开始.net探索之旅[04-21]
.net课件之多线程[04-21]
五子棋.NET源码下载[04-21]
跟我一起学.net资料(二)[04-21]
跟我一起学习.net资料(一)[04-21]
我的学习作品之酒店 管理系统 (V..[04-21]
Visual C#.NET编程精粹150例[03-18]
最优化ASP.NET ——面向对象开发..[03-18]
从前之前,后来以后[04-21]
世界上最遥远的距离[04-21]
在来三张[04-21]
从COM组件调用.NET组件编程实战[04-21]
乱画的一大堆哈哈[04-21]
我住的那栋楼下[04-21]
雨中漫步—瞬间的浪漫[04-21]
一辈子的幸福[04-21]
感悟[04-21]
鱼和水,我和你……[04-21]