Skip to content

Instantly share code, notes, and snippets.

@anicholson
Created July 17, 2013 05:43
Show Gist options
  • Save anicholson/6017961 to your computer and use it in GitHub Desktop.
Save anicholson/6017961 to your computer and use it in GitHub Desktop.
Function IsPasswordValid(ByVal Password As String, ByRef Failures As ArrayList)
Dim Criteria() As InvalidationCriterion = {
new ShorterThanLength(8),
new ConsecutiveChars,
new NoSpecialChars,
new NoNumbers,
new NoMixedCase
}
For Each criterion as InvalidationCriterion in Criteria
If criterion.fails(password)
Failures.Add(criterion.errorMessage)
End If
Next
Return (Failures.Length == 0)
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment