【发布时间】:2012-01-04 17:25:14
【问题描述】:
可能重复:
Does Dispose method still get called when Exception is thrown inside of Using statment?
在访问数据库时,我有许多 using 块。我想知道 - 如果必须在 using 块内引发异常,即使未到达块的末尾,是否仍会释放必要的资源?还是我需要在 catch 块中自己手动关闭它们?
【问题讨论】:
标签: c# asp.net .net exception-handling using-statement