Beispiel #1
0
    public void Page_Error(object sender, EventArgs e)
    {
        Exception objErr = base.Server.GetLastError().GetBaseException();
        string    err    = string.Concat(new string[]
        {
            "Error Caught in PageBase_Error event\r\nError in:",
            base.Request.Url.ToString(),
            "\r\nError Message:",
            objErr.Message.ToString(),
            "\r\nStack Trace:",
            objErr.StackTrace.ToString()
        });

        try
        {
            Chain.Model.SysError mdSysError  = new Chain.Model.SysError();
            Chain.BLL.SysError   bllSysError = new Chain.BLL.SysError();
            mdSysError.ErrorTime    = DateTime.Now;
            mdSysError.ErrorContent = err;
            mdSysError.Ipaddress    = PubFunction.ipAdress;
            mdSysError.UserID       = this._UserID;
            mdSysError.ShopID       = this._UserShopID;
            bllSysError.Add(mdSysError);
        }
        catch
        {
        }
        base.Server.ClearError();
    }
Beispiel #2
0
        protected void Application_Error(object sender, EventArgs e)
        {
            Exception objErr = base.Server.GetLastError().GetBaseException();
            string    err    = string.Concat(new string[]
            {
                "会员系统 Caught in Application_Error event\r\nError in:",
                base.Request.Url.ToString(),
                "\r\nError Message:",
                objErr.Message.ToString(),
                "\r\nStack Trace:",
                objErr.StackTrace.ToString()
            });

            try
            {
                Chain.Model.SysError mdSysError  = new Chain.Model.SysError();
                Chain.BLL.SysError   bllSysError = new Chain.BLL.SysError();
                mdSysError.ErrorTime    = DateTime.Now;
                mdSysError.ErrorContent = err;
                mdSysError.Ipaddress    = PubFunction.ipAdress;
                LoginLogic login = LoginLogic.LoginStatus();
                if (login.IsLoggedOn && login.LoginUser != null)
                {
                    mdSysError.UserID = login.LoginUser.UserID;
                    mdSysError.ShopID = login.LoginUser.UserShopID;
                }
                bllSysError.Add(mdSysError);
            }
            catch
            {
            }
        }
Beispiel #3
0
        public static void Add(Exception Err, string IP)
        {
            string content = string.Format("Error Message:{0}\r\nStack Trace:{1}", Err.Message, Err.StackTrace);

            SysError.Add(content, IP, 0, 0);
        }