?? appexception.cs
字號:
using System;
using System.Diagnostics;
namespace infoWeb.WebModules
{
/// <summary>
/// Default exception to be thrown by the website, it will
/// automatically log the contents of the exception to the
/// Windows NT/2000 Application Event Log.
/// </summary>
public class AppException: System.Exception
{
public AppException()
{
LogEvent("An unexpected error occurred.");
}
public AppException(string message)
{
LogEvent(message);
}
public AppException(string message, Exception innerException)
{
LogEvent(message);
if (innerException != null)
{
LogEvent(innerException.Message);
}
}
private void LogEvent(string message)
{
if (!EventLog.SourceExists("ThePhile.COM"))
{
EventLog.CreateEventSource("ThePhile.COM", "Application");
}
EventLog.WriteEntry("ThePhile.COM", message, EventLogEntryType.Error);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -