- Home
·
- String Manipulation
·
- Code generates a password at random by clicking the button on the form. You will need two buttons o
Code generates a password at random by clicking the button on the form. You will need two buttons o
Code generates a password at random by clicking the button on the form. You will need two buttons on your form, named command1 and command2
API Declarations
Rate Code generates a password at random by clicking the button on the form. You will need two buttons o
(2(2 Vote))
Randomize (Len(chars))
Dim r
r = Rnd(Len(chars))
Text1.Text = Text1.Text & Mid(chars, CInt(r * Len(chars)) + 1, 1)
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Randomize (Len(chars))
If Len(Text2.Text) > 0 Then
If CInt(Text2.Text) >= 0 Then
Dim I As Integer
For I = 1 To CInt(Text2.Text)
Dim r
r = Rnd(Len(chars))
Text1.Text = Text1.Text & Mid(chars, CInt((r * Len(chars))) + 1, 1)
Next I
End If
End If
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = "0"
End Sub
Code generates a password at random by clicking the button on the form. You will need two buttons o Comments
No comments yet — be the first to post one!
Post a Comment