Here is an old function I used to create a random text string.
Random rand = new Random();
string pw = "";
Char[] chars = new Char[6];
int count = 0;
while (count < 6)
{
chars[count] = (Char)rand.Next(97, 123);
pw += chars[count];
count++;
}
The rand.Next(97, 123) creates a number between 97 and 123 and converts that into a lowercase letter. The digits are numbers (0-9)are 48 - 57 so if you want numbers and letters you might need to add another random function that decides whether to calculate a number or a letter.
Hope that helps,
hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 167
Wow, I use copy and paste to help a guy out and get down repped. Awesome.
hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 167