得到的HttpContext注册Htt​​pHandlers的在web.config [英] Get Registered HttpHandlers in the Web.Config from HttpContext

查看:111
本文介绍了得到的HttpContext注册Htt​​pHandlers的在web.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让类型从当前的HttpContext 或网络注册的IHttpHandler 取值。配置?

Is there a way to get the types of the registered IHttpHandlers from a current HttpContext or the web.config?

我想看看我的的HttpHandler 在web.config登记从的WebControl

I'm trying to see if my HttpHandler is registered in the web.config from a WebControl.

推荐答案

您可以得到这样注册的HttpHandler 期从web.config中的列表:

You can get the list of registered HttpHandlers from web.config this way:

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

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

这篇关于得到的HttpContext注册Htt​​pHandlers的在web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆