Argentini.Halide.H3Identify.Ispassword C# (CSharp) Method

Ispassword() public static method

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.
return 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);
                }
            }
        }