小编sch*_*cat的帖子

来自finally块的异常

请考虑以下代码,其中LockDevice()可能会失败并在ist上抛出异常.如果从finally块中引发异常,C#中会发生什么?

UnlockDevice();

try
{
  DoSomethingWithDevice();
}
finally
{
  LockDevice(); // can fail with an exception
}

c# exception finally try-catch

5
推荐指数
1
解决办法
709
查看次数

标签 统计

c# ×1

exception ×1

finally ×1

try-catch ×1