123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using CP.Common;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using System.Web.Routing;
- namespace CP.Kjh
- {
- public class MvcApplication : System.Web.HttpApplication
- {
- protected void Application_Start()
- {
- AreaRegistration.RegisterAllAreas();
- RouteConfig.RegisterRoutes(RouteTable.Routes);
- //500 筛选器
- FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
- //日志记录
- LogHelper.SetConfig(new System.IO.FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.config"));
- }
- protected void Application_Error(object sender, EventArgs e)
- {
- //Exception lastError = Server.GetLastError();
- //if (lastError != null)
- //{
- // string strExceptionMessage = string.Empty;
- // HttpException httpError = lastError as HttpException;
- // if (httpError != null)
- // {
- // int httpCode = httpError.GetHttpCode();
- // if (httpCode == 400 || httpCode == 404)
- // {
- // Response.StatusCode = 404;
- // Server.ClearError();
- // return;
- // }
- // }
- // Response.StatusCode = 500;
- // Server.ClearError();
- //}
- }
- }
- }
|