基本异常处理

try
{
    /* code that could throw an exception */
}
catch (Exception ex)
{
    /* handle the exception */
}

请注意,使用相同代码处理所有异常通常不是最佳方法。
这通常在任何内部异常处理例程失败时使用,作为最后的手段。