469,925 Members | 1,507 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,925 developers. It's quick & easy.

How to generate random passwords

Joe
Hi,

I want to generate a random password every time a new user account is
created. I want to include small and capital letters and 0 to 9 digits. Can
someone give me some idea as how should I do it? I am a beginner in ASP.NET
and using VB.net to code the pages so please do not give me any clues in C#
because I don’t know that language.

Thanks
Joe

Nov 18 '05 #1
2 1428
I have not done this so I have no code to offer, but here are the general
steps that you could implement.

1) Create an array of characters that contains all the valid characters in
the password.
2) Use the Math.Random class to randomly generate a number that is less
then the size of the just-created array. This will be you index into the
array.
3) Determine how many letters you want and loop that number of times. Each
time through, append the new character to a password variable based on the
random index created.
"Joe" <Jo*@discussions.microsoft.com> wrote in message
news:CD**********************************@microsof t.com...
Hi,

I want to generate a random password every time a new user account is
created. I want to include small and capital letters and 0 to 9 digits. Can someone give me some idea as how should I do it? I am a beginner in ASP.NET and using VB.net to code the pages so please do not give me any clues in C# because I don't know that language.

Thanks
Joe

Nov 18 '05 #2
http://www.obviex.com/Samples/Password.aspx

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Joe" <Jo*@discussions.microsoft.com> wrote in message
news:CD**********************************@microsof t.com...
Hi,

I want to generate a random password every time a new user account is
created. I want to include small and capital letters and 0 to 9 digits. Can someone give me some idea as how should I do it? I am a beginner in ASP.NET and using VB.net to code the pages so please do not give me any clues in C# because I don't know that language.

Thanks
Joe

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Laphan | last post: by
2 posts views Thread by Kent | last post: by
15 posts views Thread by John Cassidy | last post: by
7 posts views Thread by MattB | last post: by
6 posts views Thread by comp.lang.php | last post: by
15 posts views Thread by Orchid | last post: by
reply views Thread by Jonathan Boivin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.