Skip to main content
 首页 » 编程设计

c#之数字的正则表达式

2024年01月18日33birdshome

如何建立正则表达式来检查它必须是0-999999999之间的数字。

选择范围验证器。

请您参考如下方法:

如果您要控制范围内的数字,可以使用rangevalidator

MaximumValue    Specifies the maximum value of the input control 
MinimumValue    Specifies the minimum value of the input control 
 
<asp:RangeValidator 
ControlToValidate="tbox1" 
MinimumValue="1" 
MaximumValue="999999999" 
Type="Number" 
EnableClientScript="false" 
runat="server" />