A hint
Code:Dim prng As New Random Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim allowedCH As New System.Text.StringBuilder("`1234567890-=~!@#$%^&*()_+qwertyuiop[]\QWERTYUIOP{}|asdfghjkl;'ASDFGHJKL:""zxcvbnm,./ZXCVBNM<>?") Dim newRandCharString As New System.Text.StringBuilder Stop 'press F8 and use the debugger to gain understanding Do While allowedCH.Length > 0 Dim idx As Integer = prng.Next(allowedCH.Length) newRandCharString.Append(allowedCH(idx)) allowedCH.Remove(idx, 1) Loop Debug.WriteLine(newRandCharString.ToString) End Sub




Reply With Quote
