求ASP.NET中List<object>[ ]的用法
List<object>[]list=newList<object>[2];那么怎样去添加?怎样读取?绑定GridridView怎么绑定?...
List<object>[] list = new List<object>[2];那么怎样去添加?怎样读取?绑定GridridView怎么绑定?
展开
2个回答
展开全部
public struct MonitorService
{
public string ServiceName;
public string ServiceDescription;
}
List<MonitorService>[] list = new List<MonitorService>[2];
//赋值
MonitorService service=new MonitorService();
service.ServiceName="yxservice";
service.ServiceDescription="demo";
list.Add(service);
//读取
foreach (MonitorService s in this.service)
{
console.write(service.ServiceName);
console.write(service.ServiceDescription);
}
{
public string ServiceName;
public string ServiceDescription;
}
List<MonitorService>[] list = new List<MonitorService>[2];
//赋值
MonitorService service=new MonitorService();
service.ServiceName="yxservice";
service.ServiceDescription="demo";
list.Add(service);
//读取
foreach (MonitorService s in this.service)
{
console.write(service.ServiceName);
console.write(service.ServiceDescription);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询