C#中如下的ArrayList如何遍历?或者有没有更好的数据结构用来存储下面的数据?

ArrayList Test = new ArrayList();

Test.Add(1);
Test.Add(2);
Test.Add(3);
Test.Add("Isthis");
String[] s = {"a","b","c"};
Test.Add(s);

foreach (object o in Test)
{
Type t = o.GetType();
if (t.Name == "Int32")
{}
else if (t.Name == "String[]")
{
string[] ss = o as string[];
}

}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2010-09-21
foreach (System.Collections.IEnumerator ie in Test.GetEnumerator())
{
//ooxxooxx
}
第2个回答  2010-09-21
foreach( object dt in test )
{ ……… }
相似回答