HttpRuntimeSection.MaxUrlLength 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 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
屬性值
網址長度,以字元數計算。 預設是260。
- 屬性
備註
該財產的 MaxUrlLength 價值可以是任何整數、零或更大。
Note
極小的數值可能會讓網站無法使用。
如果請求網址長度(即屬性 Path 的值)超過設定大小限制,ASP.NET 會回傳 HTTP 400(惡意請求)狀態碼
你可以在設定檔中設定 MaxUrlLength 元素屬性 httpRuntime 來設定這個值。 更多資訊請參閱 httpRuntime Element(ASP.NET 設定結構)。