HttpRuntimeSection.MaxRequestLength プロパティ

定義

要求の最大サイズを取得または設定します。

public:
 property int MaxRequestLength { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("maxRequestLength", DefaultValue=4096)]
[System.Configuration.IntegerValidator(MinValue=0)]
public int MaxRequestLength { get; set; }
[<System.Configuration.ConfigurationProperty("maxRequestLength", DefaultValue=4096)>]
[<System.Configuration.IntegerValidator(MinValue=0)>]
member this.MaxRequestLength : int with get, set
Public Property MaxRequestLength As Integer

プロパティ値

最大要求サイズ (KB 単位)。 既定のサイズは 4096 KB (4 MB) です。

属性

例外

選択した値が RequestLengthDiskThreshold未満です。

次の例は、現在の MaxRequestLength プロパティ値を取得する方法を示しています。

// Get the MaxRequestLength property value.
Response.Write("MaxRequestLength: " +
  configSection.MaxRequestLength + "<br>");

// Set the MaxRequestLength property value to 2048 kilobytes.
configSection.MaxRequestLength = 2048;
' Get the MaxRequestLength property value.
Response.Write("MaxRequestLength: " & _
  configSection.MaxRequestLength & "<br>")

' Set the MaxRequestLength property value to 2048 kilobytes.
configSection.MaxRequestLength = 2048

注釈

MaxRequestLength プロパティは、入力ストリームのバッファリングしきい値の制限を指定します。 たとえば、この制限を使用して、サーバーに大きなファイルを投稿するユーザーによって発生するサービス拒否攻撃を防ぐことができます。

このプロパティに割り当てられる値は、 RequestLengthDiskThreshold プロパティに割り当てられた値以上である必要があります。

適用対象