> Private Function GeneratePassword(ByVal passwordLength As Integer) As String > Dim Vowels() As Char = New Char() {"a", "e", "i", "o", "u"} > Dim Consonants() As Char = New Char() {"b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v"} > Dim DoubleConsonants() As Char = New Char() {"c", "d", "f", "g", "l", "m", "n", "p", "r", "s", "t"} > Dim wroteConsonant As Boolean 'boolean > Dim rnd As New Random > Dim passwordBuffer As New System.Text.StringBuilder > wroteConsonant = False > > For counter As Integer = 0 To passwordLength > If passwordBuffer.Length > 0 AndAlso (wroteConsonant = False) AndAlso (rnd.Next(100) < 10) Then > passwordBuffer.Append(DoubleConsonants(rnd.Next(DoubleConsonants.Length)), 2) > counter += 1 > wroteConsonant = True > Else > If (wroteConsonant = False) AndAlso (rnd.Next(100) < 90) Then > passwordBuffer.Append(Consonants(rnd.Next(Consonants.Length))) > wroteConsonant = True > Else > passwordBuffer.Append(Vowels(rnd.Next(Vowels.Length))) > wroteConsonant = False > End If > End If > Next > 'size the buffer > passwordBuffer.Length = passwordLength > Return passwordBuffer.ToString > End Function >Thanks