翱翔.Net

释放.Net的力量
posts - 75, comments - 1131, trackbacks - 5, articles - 18
  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理

公告

把异常写入Application事件

Posted on 2004-11-11 16:25 Hover 阅读(913) 评论(2) 编辑 收藏

        protected void LogEvent(string message, EventLogEntryType entryType)
  
{
   
if (!EventLog.SourceExists("ThePhile.COM"))
   
{
    EventLog.CreateEventSource(
"ThePhile.COM""Application");
   }

   EventLog.WriteEntry(
"ThePhile.COM", message, entryType);
  }