try this
System.Collections.ArrayList arraylist = new System.Collections.ArrayList();
arraylist.Add("firstValue");
arraylist.Add(2);
arraylist.Add("3rdValues");
string value = arraylist[0] as string;
var val2 = arraylist[1];
foreach (var item in arraylist)
{
Console.WriteLine(item);
}