
.NET Programming Fundamentals • Chapter 5 211
…
Catch [exception [As type]] [When expression]
catchStatementsn]
[Finally
finallyStatements]
End Try
The Try keyword basically turns the exception handler on.This is code that
you believe is susceptible to errors and could cause an exception.The compound
statement following the Tr y keyword is the “guarded” section of code. If an
exception occurs inside the guarded code, it will throw an exception that can
then be caught, allowing your code to handle it appropriately.The Catch key-
word allows you to handle the exception.You can use multiple catch blocks to
handle specific exceptions.The type is a class filter ...