Regex r = new Regex(@"^\d+$"); if (r.Match(vlannumber).Success) { sql += " and a.vlannumber=" + vlannumber; } else { sql += " and a.memo like '%" + vlannumber + "%'"; }…
记得最开始 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) { Co…