捕捉运行时错误
 
 

VB.NET and C# support common and language specific ways to handle errors at runtime. The Try statement is available in both C# and VB.NET to trap errors, while the On Error statement is available in VB.NET and Goto is only in C#.

VB.NET 和 C#支持公共的和特定语言的运行时错误处理方法。Try 语句在 C# 和 VB.NET中都可用来捕捉错误,然而 On Error 语句在 VB.NET 中可用而 Goto 仅在 C# 中可用。

For more information on the Try, On Error, and Goto statements beyond what is mentioned in this guide, see the documentation that comes with your development environment.

关于 Try, On Error, 和 Goto 语句的详细信息已超出本手册的所涉及内容,请参见开发环境集成的文档。