www.pudn.com > WorkflowDesigner.rar > CommFunction.cs, change:2007-11-21,size:1407b


using System; 
using System.Collections.Generic; 
using System.Text; 
using System.Text.RegularExpressions; 
 
namespace WorkflowDesigner 
{ 
    public class CommFunction 
    { 
        public CommFunction() 
        { } 
 
        /// <summary> 
        /// 判断输入的字符串是否是工作日格式(5位,2位小数) 
        /// </summary> 
        /// <param name="strWordDay"></param> 
        /// <returns></returns> 
        public static bool IsWorkDay(String strWordDay) 
        { 
            string regex = "^\\d{1,5}(\\.\\d{1,2})?$"; 
            RegexOptions options = ((RegexOptions.IgnorePatternWhitespace | RegexOptions.Multiline)| RegexOptions.IgnoreCase); 
            System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(regex, options); 
            return reg.IsMatch(strWordDay); 
        } 
 
        /// <summary> 
        /// 判断是否整型(8位) 
        /// </summary> 
        /// <param name="strInt"></param> 
        /// <returns></returns> 
        public static bool IsInteger(String strInt) 
        { 
            string regex = "^\\d{1,8}?$"; 
            RegexOptions options = ((RegexOptions.IgnorePatternWhitespace | RegexOptions.Multiline) | RegexOptions.IgnoreCase); 
            System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(regex, options); 
            return reg.IsMatch(strInt); 
        } 
    } 
}