IntegerValidatorAttribute.ExcludeRange 属性    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
public:
 property bool ExcludeRange { bool get(); void set(bool value); };public bool ExcludeRange { get; set; }member this.ExcludeRange : bool with get, setPublic Property ExcludeRange As Boolean属性值
如果必须排除值,则为 true;否则为 false。 默认值为 false。
示例
下面的示例演示如何使用 ExcludeRange 属性。
[ConfigurationProperty("maxAttempts", DefaultValue = 101,
    IsRequired = true)]
[IntegerValidator(MinValue = 1, MaxValue = 100,
    ExcludeRange = true)]
public int MaxAttempts
{
    get
    {
        return (int)this["maxAttempts"];
    }
    set
    {
        this["maxAttempts"] = value;
    }
}
<ConfigurationProperty("maxAttempts", _
DefaultValue:=101, _
IsRequired:=True), _
IntegerValidator(MinValue:=1, _
MaxValue:=100, _
ExcludeRange:=True)> _
Public Property MaxAttempts() As Integer
    Get
        Return Fix(Me("maxAttempts"))
    End Get
    Set(ByVal value As Integer)
        Me("maxAttempts") = value
    End Set
End Property
注解
范围包含 MinValue 和 MaxValue 属性值。 当 ExcludeRange 属性值为 true时,允许的值超出范围。