i am working on a password encryptor/decryptor and i need to produce 9 random characters from a-z every click of a button. anyone who has and idea or suggestion please help. thanks to all!!!!
Printable View
i am working on a password encryptor/decryptor and i need to produce 9 random characters from a-z every click of a button. anyone who has and idea or suggestion please help. thanks to all!!!!
VB Code:
MsgBox Chr(Int((122 - 97 + 1) * Rnd) + 97)
Mendhak, are you really in Ulaan Batoor?
Ugu'i.
:)
Wow, I am impressed. Last time I was there was in 1997, didn't think too much of it. (Off topic, I know, sorry) What nationality are you/what do you there?
I'm currently defacing the Great Wall of China with my Great Can of Spray Pain. :afrog:Quote:
Originally posted by madjon
Wow, I am impressed. Last time I was there was in 1997, didn't think too much of it. (Off topic, I know, sorry) What nationality are you/what do you there?
(Off-topic stuff in PMs... or this one will get deleted.)
thanks Mendhak.. very big help. Thank you!
the code u gave me when first fired always give me <snphhuatv> and unloaded. then when ran again gives me the same value <snphhuatv>
what i need is when the function is called it genereates an entirely new set of 9 characters.
need answers ASAP. Thanks!
Post the code you're using.
Did you remember to use the Randomize statement?
VB Code:
Public Function generatePassword() As String Dim x As Integer Dim tmpStr As String For x = 1 To 9 tmpStr = tmpStr & Chr(Int((122 - 97 + 1) * Rnd) + 97) Next generatePassword = tmpStr End Function
this is the code try putting this function on a form and have a button call it. notice that the first set will always give you = snphhuatv =
With the randomize function there, this will not happenVB Code:
public Function generatePassword() As String Dim x As Integer Dim tmpStr As String Randomize For x = 1 To 9 tmpStr = tmpStr & Chr(Int((122 - 97 + 1) * Rnd) + 97) Next generatePassword = tmpStr End Function
You need randomize only once, put it in form_load or sub main()