Random numbers and letters

  • Thread starter Thread starter aahmad76
  • Start date Start date
A

aahmad76

Can anyone please help me. I am trying to desing a
program that will create a 10 digit alphanumeric
password. I am new to the Vb.net environment, and
sometimes have no idea what to do.
I appreciate any help!!!


Thank you
 
Just for clarity's sake let me understand.... you are writing an application
using VB.Net but you are having a problem with the routine that generates
random passwords?

Would you prefer to post a pseudocode version or your first attempt at
writing it in order to have it corrected or do you want somebody to just
write the complete function?
 
Hi,

I played around for a little while with 'registration' numbers. My approach
was probably too simplistic but every digit (number or letter) in the
registration depended on another digit in the registration. For example; the
fifth digit had to be equal to the 7th digit + 3 minus the value of the 2nd
digit and so on... For letters I just used the ASCII number.

I used a random number generator to get an integer and generate the rest of
the registration number, it kept looping until it got a sequence that
worked, surprisingly it worked and was reasonably fast. (Did in C++ on the
Mac.)

I assume it's similar to what you're after. Sorry, no code - never used it
and it got lost somewhere :-(

Paul
 
here you go, one instant password generator...
only using 0->9, a->z and A->Z



Public Shared Function CreatePassword() As String
Dim passwd As String = ""
Dim r As New Random(CInt(Now.Ticks Mod Integer.MaxValue))
For i As Integer = 0 To 9

Dim number As Integer = r.Next(62)
If (number > 35) Then
number += 13 '6 chars between A->Z and a->z (+7 see below)
ElseIf (number > 9) Then
number += 7 '7 chars between 0->9 and A->Z
End If
passwd &= Chr(number + 48) '0 = chr(48) , random number is 0-based
Next i
Return passwd
End Function


dominique
 
Back
Top