2
System.webServer/Security/requestFilteringセクションがアプリケーションのweb.configファイル内に存在するかどうかをプログラムで判断できます。 私はsystem.webのような他のセクションでは以下のコードを使用して実行できますが、これまでsystem.WebServerでは不運でした。System.webServer/Security/requestFilteringセクションがプログラムによって存在するかどうかを確認する方法?
var config = WebConfigurationManager.OpenWebConfiguration("~");
HttpRuntimeSection section = config.GetSection("system.web/httpRuntime") as HttpRuntimeSection;
Label1.Text = section.MaxRequestLength.ToString();