A Simple Function To Generate A Random Password Of A Given Set Of Characters
' /* In A Code Module Add This: */ Public Function Gen_Rand_Password(PassLength As Integer) As String ' /* Dimension A Variable To Contain The Random Password */ Dim RetVal As String ' /* Dimension Variables To Contain The Upper and Lower Random Boundaries */ Dim Max As Integer Dim Min As Integer ' /* Set The Limits Of Min and Max To Character Codes Relevant To The Keyboard */ Max = 126 Min = 48 ' /* Set The Random Number Generator, Using Timer as the Seed */ ' /* This Makes The Psuedo-Random Number A Little More Random */ Randomize Timer ' /* You Can Change This To The Desired Length, 8 is Pretty Much A */ ' /* Standard Password Length */ If PassLength < 8 Then ' /* Return From Function With An Error */ Gen_Rand_Password = "error: invalid length" End If ' /* Loop Until We Reach The Desired Length Of The Password */ For I = 1 To PassLength ' /* Concantenate (append) RetVal with Random Keyboard Character */ RetVal = RetVal & Chr(Int((Max - Min + 1) * Rnd + Min)) Next I ' /* Return That Value To The Calling Procedure */ Gen_Rand_Password = RetVal End Function ' /* In Your Form (or In Another Procedure) [Call It Like This] */ ' /* The Value Passed To The Function (8, In This Case) */ ' /* Is The Number Characters That Will Be Returned */ RandomPassword = Gen_Rand_Password(8)
About the Author
Die Monster! You don't belong in this world!
It was not by my hand, that I am once again given flesh. I was called
here by humans, who wish to pay me tribute!
TRIBUTE! You steal men's souls and make them your slaves!
Perhaps the same could be said of all religions....
Your words are as empty as your soul. Mankind ill needs a savior such as you!
What is a man?
Throws A Wine-Filled Goblet
A miserable little pile of secrets! But enough talk!
Have at you!