|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
auto generate password
how to i generate a password that contains 11 chars including alphabets (Uppercase and lowercase) and numbers. However, there should not be "one", "o", "zero", "uppercase i" and "lowercase L" in the password .
pls help asap.. thanks.. |
|
#2
|
||||
|
||||
|
Quote:
PHP Code:
Quote:
|
|
#3
|
|||
|
|||
|
well, your method doesn't work..
![]() any other ways?? |
|
#4
|
|||
|
|||
|
Make
Code:
validChars[random(validChars.length())]; into Code:
String.valueOf( validChars.charAt( Math.random() * validChars.length ) ) Last edited by bricker42 : October 16th, 2002 at 11:07 PM. |
|
#5
|
|||
|
|||
|
hi,
i tried the method but i got this error: "Attempt to reference method length in class java.lang.String as an instance variable." ![]() |
|
#6
|
|||
|
|||
|
Sorry, it should be validChars.length()
|
|
#7
|
|||
|
|||
|
now i get this error..
Quote:
how do i solve it.??? Pls reply asap.. this is very important.. |
|
#8
|
|||
|
|||
|
Ya see bricker42, this is why it's better to post psuedo code. Some characters simply want you to do their work FOR them. There is no indication that he has even tried. I'm done!
|
|
#9
|
|||
|
|||
|
hey man... i did tried ok...
it just doesn't work... can you not accuse others of things they did not do... |
|
#10
|
||||||
|
||||||
|
Quote:
Quote:
Quote:
Actually, even though I have only been looking at Java for a couple of weeks, I decided to turn the psuedo-code I gave into Java code. It took me about 15 minutes and I had the code working just fine. First run gave me 'w0z7k2TRowc', the second '7FvR7nk2ivk'. Did you search a manual or book for "Random"? Otherwise known as RTFM. Better yet, did you search the internet for it? I did, and I didn't bug anybody to do it for me. Quote:
Good luck! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > auto generate password |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|