用反射来在方法里获取泛型对象的属性

1. 获取属性对象

  PropertyInfo pCode = TObject.GetType().GetProperty("Code");

2. pCode.GetValue(item, null).ToString()

原文地址:https://www.cnblogs.com/movingcity/p/3227621.html