private void Application_Error(object sender, EventArgs e) { ProvideCommon pcObject = new ProvideCommon(); string year = DateTime.Now.Year.ToString(); string month = DateTime.Now.Month.ToString(); StringBuilder sbText = new StringBuilder(); sbText.Append(Server.MapPath("~/Error")); sbText.Append(year); sbText.Append("/"); sbText.Append(month); pcObject.WriteSysErr(Server.GetLastError().GetBaseException(), Request.Url.ToString(), sbText.ToString()); Server.ClearError(); sbText.Remove(0, sbText.Length); sbText.Append(WebConfig.BaseConfig.sWUrl); sbText.Append("/Err/?url="); sbText.Append(Request.Url.ToString()); Response.Redirect(sbText.ToString(), false); }