如何循环遍历List集合的每一个元素
锦上添权 2011-08-17 02:00:52 public kehu(string id,string time,string name,int count)
{
this.Id = id;
this.Time = time;
this.Name = name;
this.Count = count;
}
构造函数
List<kehu> kehulist = new List<kehu>();
kehu k1 = new kehu("1001", "10:10:00", "老张", 5);
如何循环遍历出集合中的每一个元素呢
要求打印出来的是这样:
id:1001
time:10::1:00
name:老张
count:5