开发者

How can you see the collection of registered httphandlers?

开发者 https://www.devze.com 2023-04-06 16:30 出处:网络
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

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

精彩评论

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