Generating random strings
- From: Mike P <mike.parr@xxxxxxxxx>
- Date: Thu, 31 May 2007 01:31:02 -0700
I am generating 12 random strings and my code works fine when I step
through, but when I then let it run without stepping through and
populate a listbox with the array I am building, I get the same value
repeated 12 times. Here is my code :
protected void btnGenerate_Click(object sender, EventArgs e)
{
string strDomainName = txtDomainName.Text.ToString();
string strEmailAddress = "";
string strEmailAddressComplete = "";
ArrayList arrEmailAddresses = new ArrayList();
for (int i = 0; i <= 12; i++)
{
//create 12 random email addresses for domain
EmailAddressGenerator emg = new EmailAddressGenerator();
strEmailAddress = emg.GenerateEmailAddress();
strEmailAddressComplete = strEmailAddress + "@" +
strDomainName;
//add email addresses to array
arrEmailAddresses.Add(strEmailAddressComplete);
}
foreach (string address in arrEmailAddresses)
{
lstEmailAddresses.Items.Add(address);
}
}
*** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: Generating random strings
- From: Alexey Smirnov
- Re: Generating random strings
- From: Alexey Smirnov
- Re: Generating random strings
- Prev by Date: Re: Website restrictions
- Next by Date: Re: OWC Pivot approach
- Previous by thread: User !profile data
- Next by thread: Re: Generating random strings
- Index(es):
Relevant Pages
|