更新时间:2022-10-16 12:24:23
可以尝试吗?
var obj = new[]{
new { name= "Id", index= "Id", width= 40, align= "left" },
new { name= "Votes", index= "Votes", width= 40, align= "left" },
new { name= "Title", index= "Title", width= 200, align= "left"}
};
您应该能够像这样访问匿名类数组
and you should be able to access the anonymous class array like this
if (obj[0].align == "left")
{
...
}