|
-
May 26th, 2004, 04:32 AM
#1
Thread Starter
Addicted Member
anyone has an idea on how to produce 9 random letters?
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!!!!
-
May 26th, 2004, 04:38 AM
#2
VB Code:
MsgBox Chr(Int((122 - 97 + 1) * Rnd) + 97)
-
May 26th, 2004, 04:42 AM
#3
Addicted Member
Mendhak, are you really in Ulaan Batoor?
-
May 26th, 2004, 04:46 AM
#4
Ugu'i.
-
May 26th, 2004, 04:53 AM
#5
Addicted Member
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?
-
May 26th, 2004, 04:57 AM
#6
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?
I'm currently defacing the Great Wall of China with my Great Can of Spray Pain. 
(Off-topic stuff in PMs... or this one will get deleted.)
-
May 26th, 2004, 08:02 PM
#7
Thread Starter
Addicted Member
thanks
thanks Mendhak.. very big help. Thank you!
-
May 27th, 2004, 01:58 AM
#8
Thread Starter
Addicted Member
ei! got a slight problem!
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!
-
May 27th, 2004, 02:10 AM
#9
Post the code you're using.
-
May 27th, 2004, 02:12 AM
#10
Addicted Member
Did you remember to use the Randomize statement?
-
May 27th, 2004, 02:26 AM
#11
Thread Starter
Addicted Member
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 =
-
May 27th, 2004, 02:50 AM
#12
Lively Member
VB 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
With the randomize function there, this will not happen
very handy: [vbcode][/vbcode]
VB.NET - VB6 - VBA - ASP - RPG(AS/400) - C++ - java - SQL
look in the help, many probs can be solved that way.
I know, i'm to lazy too.
PLEASE PUT RESOLVED IF RESOLVED!!
-
May 27th, 2004, 07:51 AM
#13
You need randomize only once, put it in form_load or sub main()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|