Foxtable(狐表)用户栏目专家坐堂 → 错误捕获问题?


  共有1854人关注过本帖树形打印复制链接

主题:错误捕获问题?

帅哥哟,离线,有人找我吗?
luodang2050
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:585 积分:5674 威望:0 精华:0 注册:2014/5/21 10:30:00
错误捕获问题?  发帖心情 Post By:2016/7/18 17:04:00 [只看该作者]

如题,怎么捕获发生错误的位置?

以下为错误捕获后输出提示!

'函数调用0========================
'Functions.Execute("捕获错误输出",ex,[s])
'ex:错误的对象
's:自定义错误提醒
'函数调用1========================
Dim ex As system.SystemException = args(0)
Dim s As String
s &= "Message:" & ex.Message
s &= _hl & "Source:" & ex.Source
s &= _hl & "HelpLink:" & ex.HelpLink
's &= _hl & "Data:" & ex.Data
If ex.Data.Count > 0 Then
    Dim tmp As String
    For Each de As System.Collections.DictionaryEntry In ex.Data
        tmp &= de. Key.ToString() & "'" & de.Value
    Next
    MessageBox.Show("ex.data:" & _hl & tmp)
End If
If ex.InnerException IsNot Nothing Then
    s &= _hl & "InnerException:" & ex.InnerException.ToString( )
End If
s &= _hl & "TargetSite:" & ex.TargetSite.ToString( )
s &= _hl & "StackTrace:" & ex.StackTrace

If args.length > 1
    s = args(1) & _hl & s
End If
MessageBox.Show(s)
Return 0


 回到顶部
帅哥哟,离线,有人找我吗?
Hyphen
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/7/18 18:00:00 [只看该作者]

什么位置?错误代码的位置?没有办法,只能像上面一样输出错误信息

 回到顶部