protected void Application_Error(object sender, EventArgs e) { // 在出现未处理的错误时运行的代码 Exception ex = Server.GetLastError().GetBaseException(); if (ex.GetType().Name.Equals("HttpException")) { HttpException httpEx = (HttpException)ex; int httpCode = httpEx.GetHttpCode(); if (httpCode == 404) return; } Logger.Error("程序发生未捕获的异常\t\t\t" + HttpContext.Current.Error.Message + "\r\n" + ex.StackTrace, HttpContext.Current.Error); }
解决 Global.asax的Application_Error中记录"文件不存在"的问题
最新推荐文章于 2016-04-07 16:29:00 发布