HttpRuntimeSection.MaxUrlLength 屬性

定義

取得或設定 HTTP 要求中 URL 的最大可能長度 (以字元數為單位)。

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

屬性值

URL 的長度 (以字元數為單位)。 預設值為 260。

屬性

備註

屬性的值 MaxUrlLength 可以是任何整數、零或更大。

注意

極小的值可能會讓網站無法使用。

如果要求 URL 的長度 (,也就是屬性) 的值 Path 超過設定的大小限制,ASP.NET 傳回 HTTP 400 (不正確的要求) 狀態碼

您可以藉由設定 專案的 屬性 httpRuntime ,在組態檔中設定 MaxUrlLength 此值。 如需詳細資訊,請參閱 HTTPRuntime 元素 (ASP.NET 設定架構)

適用於