【问题标题】:Response.Redirect() inside a try-finally [duplicate]try-finally 中的 Response.Redirect() [重复]
【发布时间】:2011-05-28 07:19:41
【问题描述】:

可能重复:
Will code in finally run after a redirect?

你好,

当我调用 Response.Redirect() 并将 EndResponse 设置为 true/false 时,会发生什么情况? finally 会被调用吗?

【问题讨论】:

    标签: c# asp.net response.redirect try-finally


    【解决方案1】:

    try/finally 中的 finally 块将总是被调用 - 这就是 finally 的意义所在。

    此处描述了异常(次要):Conditions when finally does not execute in a .net try..finally block

    【讨论】:

    • +1 感谢您提供有用的链接。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-19
    • 2016-03-28
    • 2014-02-28
    • 2015-02-16
    • 2010-11-25
    • 1970-01-01
    • 2018-07-18
    相关资源
    最近更新 更多