VB.net 如何捕获方法的异常,如同java的throws
如果有一个按钮事件方法:
public sub ddd(sender as object,e as system.eventArgs) handles xx.click throw exception
end sub
有没有针对此方法的异常捕获,类似于上面红色部分,而不是在内部通过try..cathch
[解决办法]
public sub ddd(sender as object,e as system.eventArgs) handles xx.click throw exceptionTry'异常发生处msgbox(1/0)catch ex As ExceptionMsgBox(ex.Message)'错误信息Finally'最后要执行的代码End TryEnd sub