Argentini.Halide.H3Identify.Ispassword C# (CSharp) 메소드

Ispassword() 공개 정적인 메소드

Uses RegEx to check for password formatting. Alpha-numeric characters and basic typewriter symbols are allowed.
public static Ispassword ( string inputpassword, int minLen, int maxLen ) : System.Boolean
inputpassword string password string to validate.
minLen int Minimum length of valid password.
maxLen int Maximum length for valid password.
리턴 System.Boolean
        public static Boolean Ispassword(string inputpassword, int minLen, int maxLen)
        {
            if (H3Text.FixNull(inputpassword) == "" || minLen < 1 || maxLen < 1)
            {
                return (false);
            }

            else
            {
                string strRegex = "^.{" + minLen.ToString() + "," + maxLen.ToString() + "}$";

                Regex re = new Regex(strRegex);

                if (re.IsMatch(inputpassword))
                {
                    return (true);
                }

                else
                {
                    return (false);
                }
            }
        }