472,139 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,139 software developers and data experts.

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 1488
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 Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.