private bool userMeetsPolicy(string username, PWDTK.UserPolicy userPolicy) { UserPolicyException usrEx = new UserPolicyException(""); if (PWDTK.TryUserNamePolicyCompliance(username, userPolicy, ref usrEx)) { return(true); } else { throw new Exception(usrEx.Message); } }