Consider the my following code:
for (int a = 0; a < isim.Count; a++)
{
Console.WriteLine(nu[a] + "\t" + isim[a] + "\t" +mail[a]);
}
Consider the my following code:
for (int a = 0; a < isim.Count; a++)
{
Console.WriteLine(nu[a] + "\t" + isim[a] + "\t" +mail[a]);
}
You are not checking to see if nu[]
and mail[]
are at least as large as isim[]
.
At least not in the code fragment you supplied. Provide more details on the error and more of a code sample if you want a more detailed answer.
ArrayList mail = new ArrayList();
isim.Add("mail0@gmail.com");
isim.Add("mail1@yandex.com");
isim.Add("mail2@hotmail.com");
isim.Add("mail3@gmail.com");
isim.Add("mail4@gmail.com");
Instead of adding to the isim
arraylist you should add them to mail
arraylist.
ArrayList mail = new ArrayList();
mail.Add("mail0@gmail.com");
mail.Add("mail1@yandex.com");
mail.Add("mail2@hotmail.com");
mail.Add("mail3@gmail.com");
mail.Add("mail4@gmail.com");
You clearly have more elements in isim than mu. All mail addresses are being stored in isim. Check your code.