Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只是好奇而已。我刚刚使用 try-catch-finally 用 C# 编写了我的第一个主要代码。我想知道是否存在这样的方法来处理错误,如果在 finally 块内还有其他要处理的东西。谢谢。
我对c一无所知,但逻辑告诉我你是否在try-catch-finally之外,你超出了条件语句的范围,因此需要一个新的try-catch-finally或类似的东西
您可以在 finally 子句中嵌套另一个 try-catch 块(如果我正确理解您的问题):
try { ... } catch { ... } finally { try { ... } catch { ... } }