how to make a random password

  • Thread starter Thread starter DaveF
  • Start date Start date
One algorithm is to chose numbers at random (which is in the libraries), and
convert them to characters by using the ASCII code. Then, store all of the
characters in an array and concatenate them to make a string.
 
Hari said:
One algorithm is to chose numbers at random (which is in the libraries), and
convert them to characters by using the ASCII code. Then, store all of the
characters in an array and concatenate them to make a string.

Hari,

Here's a quick and dirty way to do it :)


Sub Main()
For i As Integer = 0 To 1000
Console.WriteLine(RandomPassword(10))
Next
End Sub

Private Function RandomPassword(ByVal Length As String) As String
Return GUID.NewGuid().ToString("N").Substring(0, Length)
End Function


Hope this helps some :)

Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top