Password Generator


Private Function Generate(ByVal IntNum As Integer) As String
Dim i As Integer, intChar As Integer
Dim str As String

Randomize
For i = 1 To IntNum
intChar = Int((26 + 26 + 10) * Rnd)

If intChar < 26 Then
str = str & Chr$(intChar + Asc(“A”))
ElseIf intChar < 2 * 26 Then
intChar = intChar – 26
str = str & Chr$(intChar + Asc(“a”))
Else
intChar = intChar – 26 – 26
str = str & Chr$(intChar + Asc(“O”))
End If
Next i

Generate = str

End Function

Private Sub Send_Click()
Me.txtResult.Text = Generate(Val(Me.txtJResult1.Text))

End Sub

One response to “Password Generator

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s