解决 Global.asax的Application_Error中记录"文件不存在"的问题

    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
        If Server.GetLastError.GetBaseException.GetType.Name = "HttpException" Then '屏掉404页面错误
            Dim httpEx As HttpException = Server.GetLastError.GetBaseException
            If httpEx.GetHttpCode = 404 Then Return
        End If
     
        SoftLog(Server.GetLastError.ToString) '错误记录日志
    End Sub

你可能感兴趣的:(解决 Global.asax的Application_Error中记录"文件不存在"的问题)