我想知道是否有办法让程序在抛出异常后继续.例如:
Try line 1 line 2 line 3 line 4 ( here the exception is thrown and jumps to the catch) line 5 <-- i would like the program to continue its execution loging the error line 6 Catch ex as Exception log(ex.tostring) End Try
谢谢.
如果你正在做一些你知道如何恢复或者不重要的事情,那么你应该在try / catch中用特定的catch来包装那一行.
例如
原文链接:https://www.f2er.com/vb/255337.html例如
Try line 1 line 2 line 3 Try line 4 ( here the exception is throw and jumps to the catch) Catch iox as IOException ' or whatever type is being thrown 'log it End Try line 5 <-- i would like the program to continue its execution after loggin the error line 6 Catch ex as Exception log(ex.tostring) End Try