标签:
记得最开始 using System.Text.RegularExpressions;
Regex m_regex = new System.Text.RegularExpressions.Regex("^(-?[0-9]*[.]*[0-9]{0,3})$");
bool b = m_regex.IsMatch("111");
if (b == false)
{
Console.WriteLine("请填写数字");
Console.ReadLine();
}
else
{
Console.WriteLine("正确的数字");
Console.ReadLine();
}
标签:
原文地址:http://www.cnblogs.com/D-sD/p/5413448.html