I see that the Finally
in Try .. Catch
will always execute after any parts of the execution of the try catch block.
Is it any different to just skip the Finally
section and just run it after, outside the try catch block?
Example 1, Try ... Catch ... Finally ... End Try
Try
'Do something
Catch ex As Exception
'Handle exception
Finally
'Do cleanup
End Try
Example 2, Try ... Catch ... End Try ... Do the finally stuff outside
Try
'Do something
Catch ex As Exception
'Handle exception
End Try
'Do cleanup
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…