473,395 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 1564
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Laphan | last post by:
Hi All This is a strange request, but I just cannot fathom how to do it. In theory the requirement is very basic, but in practise its a noodle!! I have 10 team names like so: Team A Team...
14
by: Miranda | last post by:
Hi, I have a ASP/vbscript program that generates random passwords. The problem is I need to insert those passwords into an Access database of 327 clients. I have the random password program...
2
by: Kent | last post by:
What am I missing here. Why doesn't this produce a random string. It is kind of random. <% Const ConstantLower = "bcdfghjklmnpqrstvwxyz" Const VowelLower = "aeiou" Const Numbers = "0123456789"...
15
by: John Cassidy | last post by:
This has been driving me crazy. I've done basic C in school, but my education is mainly based on object oriented design theory where Java is our tool. For some reason, while helping a friend with a...
7
by: MattB | last post by:
I have the following code to generate random passwords for new users of an application. Const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstyvwxyz1234567890" Dim r As Int16, i As...
6
by: comp.lang.php | last post by:
/** * Generate the random security image * * @access public * @param $willUseFilePath (default false) boolean to determine if you will be using a file path * @param mixed $filePath (optional)...
15
by: Orchid | last post by:
Hello, I am looking to generate a unique ID field on MS. Access. The ID is with 10 digits with the combination of 5 Letters from the 26 letters and 5 Numbers from 1 to 9. The letters and numbers...
0
sashi
by: sashi | last post by:
Generate Random Password In the course of programming you may have cause to generate a password. The following function will generate a password of randomly selected characters up to a maximum of...
0
by: Jonathan Boivin | last post by:
If I could give an advice on your method, in fact, what I would do.. is : Generate a password with your lower security set of characters. Then upper case randomizally some letters and finally...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.