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

适用于