日期:2014-05-18  浏览次数:20899 次

问题求解??
如何使textbox的只能输入8位数字?


------解决方案--------------------
using System.Text.RegularExpressions;



string a = this.TextBox1.Text;
string b = @ "^\d{8}$ ";
Match c = Regex.Match(a, b);
if (c.Success)
{
Response.Write( " <script> alert( '8位数字 ') </script> ");
}
else
{
Response.Write( " <script> alert( '不是8位数字 ') </script> ");
}

记得给分阿