Bagikan melalui


HttpRuntimeSection.MaxRequestLength Properti

Definisi

Mendapatkan atau mengatur ukuran permintaan maksimum.

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

Nilai Properti

Ukuran permintaan maksimum dalam kilobyte. Ukuran defaultnya adalah 4096 KB (4 MB).

Atribut

Pengecualian

Contoh

Contoh berikut menunjukkan cara mendapatkan nilai properti saat ini 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

Keterangan

Properti MaxRequestLength menentukan batas untuk ambang buffering aliran input. Misalnya, batas ini dapat digunakan untuk mencegah penolakan serangan layanan yang disebabkan oleh pengguna yang memposting file besar ke server.

Nilai yang ditetapkan ke properti ini harus lebih besar atau sama dengan nilai yang ditetapkan ke RequestLengthDiskThreshold properti .

Berlaku untuk