kem*_*002 18
你的意思是这样的?
ArrayList list = new ArrayList();
YourObject myObject = new YourObject();
list.Add(myObject);
YourObject obj = (YourObject)list[0];
Run Code Online (Sandbox Code Playgroud)
循环:
foreach(object o in list)
{
YourObject myObject = (YourObject)o;
.......
}
Run Code Online (Sandbox Code Playgroud)
有关ArrayList的信息
object[] anArray = arrayListObject.ToArray();
for(int i = 0; i < anArray.Length; i++)
Console.WriteLine(((MyType)anArray[i]).PropertyName); // cast type MyType onto object instance, then retrieve attribute
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
46377 次 |
| 最近记录: |