zoukankan      html  css  js  c++  java
  • Application_Error

    //出现未捕捉的异常时,系统调用本方法,一般用于记录日志。错误页的重定向一般在web.config中设置。
            protected void Application_Error(object sender, EventArgs e)
            {
                //GetLastError() 返回Exception实例,任何Exception实例都包含如下属性,可将如下属性写入日志。
                Exception exp = HttpContext.Current.Server.GetLastError();
                string err = HttpContext.Current.Server.GetLastError().Message;
                string cls = HttpContext.Current.Server.GetLastError().Source;
                string func = HttpContext.Current.Server.GetLastError().TargetSite.Name;
            }

  • 相关阅读:
    Ethical Hacking
    Ethical Hacking
    Ethical Hacking
    National Treasures HDU
    Matrix HDU
    过山车 HDU
    Jimmy’s Assignment HDU
    Card Game Cheater HDU
    Uncle Tom's Inherited Land* HDU
    50 years, 50 colors HDU
  • 原文地址:https://www.cnblogs.com/dotnetmvc/p/3673955.html
Copyright © 2011-2022 走看看