gpt4 book ai didi

asp.net - 从 HttpContext 获取 Web.Config 中注册的 HttpHandlers

转载 作者:行者123 更新时间:2023-12-04 08:28:58 26 4
gpt4 key购买 nike

有没有办法获取注册的类型IHttpHandler s 来自当前 HttpContext或 web.config?

我想看看我的 HttpHandlerWebControl 在 web.config 中注册.

最佳答案

您可以获取注册列表HttpHandler s 从 web.config 这种方式:

using System.Configuration;
using System.Web.Configuration;

Configuration cfg = WebConfigurationManager.OpenWebConfiguration("/");
HttpHandlersSection hdlrs = (HttpHandlersSection)cfg.GetSection("system.web/httpHandlers");

关于asp.net - 从 HttpContext 获取 Web.Config 中注册的 HttpHandlers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7083911/

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