#region 判断输入的是否是数字函數
/// <summary>
/// 名称:IsNumberic
/// 功能:判断输入的是否是数字
/// 参数:string oText:源文本
/// 返回值: bool true:是 false:否
/// </summary>
public static bool IsNumberic(string oText){
 System.Text.RegularExpressions.Regex reg = new Regex("[^0-9]");
 if (reg.IsMatch(oText))
 {
  return false;
 }
 else
 {
  return true;
 }
}
#endregion


/// <summary>
  /// 判断字符串由字母和数字,下划线,点号组成.且开头的只能是下划线和字母
  /// </summary>
  /// <param name="strInput"></param>
  /// <returns>匹配则返回TRUE</returns>
  private bool CheckInput(string strInput)
  {
   Regex strRegex = new Regex(@"^([a-zA-z_]{1})([a-zA-z_0-9.]*)$");//(@"^\w+$");
   return strRegex.IsMatch(strInput);
  }

相关文章:

  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
猜你喜欢
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案