View Single Post
Old 11-16-2007, 04:35 PM   #4
Derkel
N00B Pwner
 
Last Online: 10-07-2009 10:14 PM
Join Date: Apr 2007
Location: In a House
Posts: 453
Rep Power: 3
Rep Points: 10
Derkel is on a distinguished road
Feedback: (2)
Points: 7,615.51
Bank: 38,432.60
Total Points: 46,048.11
Autism - Derkel 
Xfire derkel
Re: Mega Post of Tuts

How to Make a Random Password Generator
Create a text box and command button.
Add this code to your form:
Code:
Private Sub Command1_Click()
   Text1 = GenerateCode() 'make sure ur textbox is called Text1
End Sub

Public Function GenerateCode()
   strInputString = "1234567890abcdefghijklmnopqrstuvwxyz" 'these are the characters which will be in the password
   
   intLength = Len(strInputString)
   
   intNameLength = 7 'edit this according to how long u want ur password to be
   
   Randomize ' jus to make it random :D
   
   strName = ""
   
   For intStep = 1 To intNameLength
	   intRnd = Int((intLength * Rnd) + 1)
   
	   strName = strName & Mid(strInputString, intRnd, 1)
   Next
   
   GenerateCode = strName
End Function

Last edited by Derkel; 11-16-2007 at 04:45 PM.
Derkel is offline   Reply With Quote