M
MattB
I have the following code to generate random passwords for new users of
an application.
Const chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstyvwxyz1234567890"
Dim r As Int16, i As Int16
Dim Pswd As String = ""
For i = 1 To len
r = Int((Rnd() * 62) + 1)
Pswd = Pswd & Mid(chars, r, 1)
Next i
Return Pswd
------------
It runs alright, but in the pas couple of days it seems the first time I
run it after starting my asp.net application I always get this same
password: rhjRSwAv
I've actually gotten it three times today. That's not quite random
enough for me. Am I doing something wrong? What can I do to this code to
make the passwords less predictable? Thanks!
Matt
an application.
Const chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstyvwxyz1234567890"
Dim r As Int16, i As Int16
Dim Pswd As String = ""
For i = 1 To len
r = Int((Rnd() * 62) + 1)
Pswd = Pswd & Mid(chars, r, 1)
Next i
Return Pswd
------------
It runs alright, but in the pas couple of days it seems the first time I
run it after starting my asp.net application I always get this same
password: rhjRSwAv
I've actually gotten it three times today. That's not quite random
enough for me. Am I doing something wrong? What can I do to this code to
make the passwords less predictable? Thanks!
Matt