您的位置:程序门 -> .net技术 -> c#



arraylist 遍历问题 在线等


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


arraylist 遍历问题 在线等[已结贴,结贴人:aliuge2007]
发表于:2007-03-30 10:57:07 楼主
我在有   一个类   studen   对象   里面有属性   getid   ,getname  
我把studen   这个对象放到了arraylist   里面。。。   里面有多条记录
怎么用   foreach     取出来。。。
打印   getid   getname
发表于:2007-03-30 11:02:441楼 得分:20
for(int   i=0;i <al.count;i++)
{
            studen   sd   =   (studen)al[i];
            console.writeline(sd.getid);
            console.writeline(sd.getname);
}
发表于:2007-03-30 11:09:112楼 得分:0
d:\c#专区\student\student\form1.cs(259):   “system.collections.arraylist”并不包含对“get”的定义

不对也


快速检索

最新资讯
热门点击