错误处理(Error Handling) Visual Basic.NET的另外一个大的改进就是错误处理。Visual Basic将提供try…catch…finally结构,就象 Delphi中的那样(微软的原文是:just like those "respectable" languages :-))。例如:
Sub SafeWrite() Try Open "Testfile" ... Write #1 Catch Kill "Testfile" Finally Close #1 End Try End Sub