gpt4 book ai didi

asp.net - httpmodules 和 httphandlers 之间的交互

转载 作者:行者123 更新时间:2023-12-02 16:36:35 27 4
gpt4 key购买 nike

在我们的 asp.net 2.0 应用程序中,我们使用 httpmodule 和 httphandler 通过 cookie 计算一些指标。为了计算网络传输时间,httpmodule:EndRequest 将 Transferstart 存储在 cookie 中,而 httphandler:Processrequest 使用 datetime.now 减去 Transferstart 来确定总体网络时间。它是否正确?我也不清楚请求流程。它是不是像这样:请求 > HttpModule::OnStart > HttpModule::OnEnd > HttpHandler::ProcessRequest?

最佳答案

顺序是:

  • 模块启动
  • 处理进程请求
  • 模块 OnEnd

顺便说一句,最好使用 HttpContext.Items 属性在处理程序和模块之间共享信息,而不是使用 cookie。

关于asp.net - httpmodules 和 httphandlers 之间的交互,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/569801/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com