Thanks for that. I'll try it tonight after work. I know what you mean about formatting it a bit :~ Anyway. Can you try this for me, If you have time, Public 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 counter As Integer Dim rnd As New Random Dim passwordBuffer As New StringBuilder wroteConsonant = False For counter = 0 To passwordLength If passwordBuffer.Length > 0 And (wroteConsonant = False) And (rnd.Next(100) < 10) Then passwordBuffer.Append(DoubleConsonants(rnd.Next(Do ubleConsonants.Length)), 2) counter += 1 wroteConsonant = True Else If (wroteConsonant = False) And (rnd.Next(100) < 90) Then passwordBuffer.Append(Consonants(rnd.Next(Consonan ts.Length))) wroteConsonant = True Else passwordBuffer.Append(Vowels(rnd.Next(Vowels.Lengt h))) wroteConsonant = False End If End If Next 'size the buffer passwordBuffer.Length = passwordLength Return passwordBuffer.ToString End Function
Found it on the internet. Iv'e only just started programming, but I assumed that because it was a function. to get it to display, all I would need to do is text_change event textbox1.text = GeneratePassword
But VB.net says tjhat it's not a string???? :wtf: Any ideas? P.s. I think I might go with your's. i'm just trying to understand how to display this. Thanks ---------------------------------------------- You are you and I am I. So who is that?