VB.NET中怎么实现异常迭代捕捉,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
VB.NET异常迭代捕捉代码示例:
Dim a As Integer = 10 Dim b As Integer = 20 Dim c As Integer = 10 Dim i As Integer Dim liu As Integer Dim aaa As New System.Text.StringBuilder Try For i = 0 To 20 If b < 10 Then aa = a + 1 Try liu = (b / (a - c)) aaa.AppendLine("ok:" & b.ToString) Exit For Catch ex As Exception aaa.AppendLine("error:" & b.ToString) bb = b - 1 If b < 15 Then Throw New Exception("error") End If End Try Next Me.TextBox1.Text = aaa.ToString Catch ex As Exception MsgBox("oooo") End Try MsgBox(b.ToString) MsgBox("www")
看完上述内容,你们掌握VB.NET中怎么实现异常迭代捕捉的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注编程网行业资讯频道,感谢各位的阅读!