用正则表达式 private bool CheckValidate(string Validate) { Regex re = new Regex(@"^0|[0-9]*[1-9][0-9]*$"); if( !re.IsMatch(Validate)) { return false; } else { return true; } }