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 设置架构)

适用于