日期:2014-05-18 浏览次数:20980 次
void Main() { var salerIncomeList = new List<object>(); var objitem = new { realname = "aaa",//item.realName, username="bbb",//item.userName, commision="ccc"//income, }; salerIncomeList.Add(objitem); foreach(var obj in salerIncomeList) { System.Reflection.PropertyInfo propertyInfo=obj.GetType().GetProperty("realname"); Console.WriteLine(propertyInfo.GetValue(obj,null).ToString()); //aaa } }