Exemple #1
0
 /// <summary>
 /// 查看是否电话号码
 /// </summary>
 /// <param name="phoneNum"></param>
 /// <returns></returns>
 public static bool IsCallPhone(string phoneNum)
 {
     if (!UtilNumber.IsDigit(phoneNum))
     {
         return(false);
     }
     return(true);
 }
Exemple #2
0
        /// <summary>
        /// 查看是否手机号
        /// </summary>
        /// 其中:RegexPatterns引自uoLib.common
        /// <see cref="http://udnz.com/Works/uolib/Default.aspx"/>
        /// <param name="phoneNum"></param>
        /// <returns></returns>
        public static bool IsMobilePhone(string phoneNum)
        {
            if (!UtilNumber.IsDigit(phoneNum))
            {
                return(false);
            }

            Regex re     = new Regex(UtilRegex.MobileNum, RegexOptions.IgnoreCase);
            bool  result = re.IsMatch(phoneNum);

            return(result);
        }