/// /// 判断输入是否只是数字 /// /// public static bool IsOnlyNumber(string strInput) { System.Text.RegularExpressions.Match matchResult = null; matchResult = System.Text.RegularExpressions.Regex.Match(strInput, "^[0-9]+$"); if (matchResult.Success) { return true; } return false; }