コード例 #1
0
        private bool ChekIfPolicyWorks(PasswordPolicyDay2a policy)
        {
            var result      = Regex.Matches(policy.Password, policy.Letter);
            var checkResult = CheckResult(result, policy);

            return(checkResult);
        }
コード例 #2
0
 private bool CheckResult(MatchCollection matches, PasswordPolicyDay2a policy)
 {
     return(matches.Count <= policy.MaxOccurences &&
            matches.Count >= policy.MinOccurences);
 }