HttpRuntimeSection.MaxRequestLength Proprietà

Definizione

Ottiene o imposta le dimensioni massime della richiesta.

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

Valore della proprietà

Dimensioni massime della richiesta in KB. Le dimensioni predefinite sono pari a 4096 KB (4 MB).

Attributi

Eccezioni

Il valore selezionato è minore di RequestLengthDiskThreshold.

Esempio

Nell'esempio seguente viene illustrato come ottenere il valore della proprietà corrente 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

Commenti

La MaxRequestLength proprietà specifica il limite per la soglia di buffering del flusso di input. Ad esempio, questo limite può essere usato per impedire attacchi Denial of Service causati da utenti che pubblicano file di grandi dimensioni nel server.

Il valore assegnato a questa proprietà deve essere maggiore o uguale al valore assegnato alla RequestLengthDiskThreshold proprietà.

Si applica a