My Web.Config.xmlファイルは、クライアントのhttp要求に対するサポートされている拡張機能のセットです。これらの要求は同じHttpHandler
実装によって処理されます。拡張機能を使用して、ハンドラの機能を有効にします。以下はその構造のコピーです。設定されたHttpHandlerのリストを取得する
<system.webServer>
<handlers accessPolicy="Read, Execute, Script">
<add name="Handler1" path="*.path1" verb="*" type="namespace.class, assembly" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
<add name="Handler2" path="*.path2" verb="*" type="namespace.class, assembly" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
<add name="Handler3" path="*.path3" verb="*" type="namespace.class, assembly" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
<add name="Handler4" path="*.path4" verb="*" type="namespace.class, assembly" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
</handlers>
</system.webServer>
私は、彼らがサポートされていない要求を作成しようとしないように、クライアントは、サポートパス(機能)を取得するための最初の要求を行うことができるように、第五ハンドラを実装したいです。私は、ハンドラを追加/削除することで有効な機能を制御したいと考えています。
ハンドラの実装で設定されたハンドラの実行時のリストを取得するにはどうすればよいですか?
リストを使用して自分の応答を作成したいと考えています。
私はSystem.Web.Configuration.HttpHandlersSection
を見ましたが、system.webServer
セクションを取得しようとすると、System.Configuration.IgnoreSection
オブジェクトが戻ってきます。
このhttps://msdn.microsoft.com/en-us/library/ms151434(v=vs.110を見てみましょう.aspx –
@ S.Petrosov system.webServer要素は "WebConfigurationManager.GetSection"でサポートされていないようです。これは、System.Configuration.IgnoreSectionオブジェクトを返します。 –