HttpRuntimeSection.MaxRequestLength Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém ou define o tamanho máximo do pedido.
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
Valor de Propriedade
O tamanho máximo do pedido em kilobytes. O tamanho padrão é 4096 KB (4 MB).
- Atributos
Exceções
O valor selecionado é menor que RequestLengthDiskThreshold.
Exemplos
O exemplo seguinte mostra como obter o valor atual MaxRequestLength da propriedade.
// 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
Observações
A MaxRequestLength propriedade especifica o limite para o limiar de buffering do fluxo de entrada. Por exemplo, este limite pode ser usado para prevenir ataques de negação de serviço causados por utilizadores que publicam ficheiros grandes no servidor.
O valor atribuído a esta propriedade deve ser maior ou igual ao valor atribuído à RequestLengthDiskThreshold propriedade.