2011-09-20 10 views
5

登録されているHttpHandlerを確認するにはどうすればよいですか? 登録されたHttpHandlersをどのようにループできますか?私はハンドラがコレクションのどこかにあるが、どこにいるのだろう。ちょうどここからコピー登録されたhttphandlersのコレクションはどのように見えますか?

+0

少し拡大できますか?あなたは何を処理しようとしていますか? httphandlersはあなたの 'Web.Config'の' httpHandlers'セクションで定義されています。 –

+0

これは同じ質問ですか?http://stackoverflow.com/questions/7083911/get-registered-httphandlers-in-the-web-config-from-httpcontext? –

答えて

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

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

:WebアプリケーションからGet Registered HttpHandlers in the Web.Config from HttpContext

0

は、あなたがのConfigurationManagerを使用して1行でセクションを得ることができます。

HttpHandlersSection httpHandlers = (HttpHandlersSection)ConfigurationManager.GetSection("system.web/httpHandlers"); 
関連する問題