Handling exceptions in global.asax ASP.NET MVC

前端 未结 3 1236
梦如初夏
梦如初夏 2021-02-15 14:15

I have code which is catching all exceptions in Global.asax

 protected void Application_Error(object sender, EventArgs e) 
        {
            System.Web.HttpC         


        
3条回答
  •  名媛妹妹
    2021-02-15 14:30

    i used like this it's below

    you can get user ip like this

    var userip = context.Request.UserAgent; 
    

    and you can get your url where this error happened like this

    var ururl = System.Web.HttpContext.Current.Request.Url; 
    

    i think this will help you...

提交回复
热议问题