开发者

How can you see the collection of registered httphandlers?

How can you see which HttpHandlers are registered? How can you loop thr开发者_JAVA技巧ough the registered HttpHandlers? I suppose all the handlers are in a collection somewhere but where.


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

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

just copied from here: Get Registered HttpHandlers in the Web.Config from HttpContext


From a web application, you can get the section with one line using the ConfigurationManager.

HttpHandlersSection httpHandlers = (HttpHandlersSection)ConfigurationManager.GetSection("system.web/httpHandlers");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜