加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

如何在VB.NET中引发异常?

发布时间:2020-12-16 23:52:59 所属栏目:大数据 来源:网络整理
导读:如何在VB.NET中引发异常? 你会抛出一个新的异常。 看看Throw Statement (Visual Basic) The Throw statement throws an exception that you can handle with structured exception-handling code (Try…Catch…Finally) or unstructured exception-handling
如何在VB.NET中引发异常?
你会抛出一个新的异常。

看看Throw Statement (Visual Basic)

The Throw statement throws an exception that you can handle with
structured exception-handling code (Try…Catch…Finally) or
unstructured exception-handling code (On Error GoTo). You can use the
Throw statement to trap errors within your code because Visual Basic
moves up the call stack until it finds the appropriate
exception-handling code.

编辑

按请求和从链接

Throw New System.Exception("An exception has occurred.")

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读