VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This code makes a random password out of the letters of the alphabet

by mike (7 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 3rd May 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This code makes a random password out of the letters of the alphabet

Rate This code makes a random password out of the letters of the alphabet




'Add a label and name it label1,change its caption to "", set auto size to true
Private Sub Command1_Click()
On Error Resume Next
Label1.Caption = ""
Do
    DoEvents
    b = b + 1
    a = 52 * Rnd
    ltr = Mid(LETTERS, a, 1) ' does the actual random generation
    ltr2 = Asc(ltr) 'Numbervalue of the random Char
    Label1.Caption = Label1.Caption + Chr(ltr2) ' character value shown
Loop Until b = 25 ' The number of characters
End Sub

Download this snippet    Add to My Saved Code

This code makes a random password out of the letters of the alphabet Comments

No comments have been posted about This code makes a random password out of the letters of the alphabet. Why not be the first to post a comment about This code makes a random password out of the letters of the alphabet.

Post your comment

Subject:
Message:
0/1000 characters