摘要: public class Product{ public string ProductCode{get;set;} public string ProductName{get;set;}}//方法,传入对象为Product实例对象public void GetOrSetValue(object obj){ //获取对象类型 Type t = obj.GetType(); //通过属性名称获取对象属性 PropertyInfo name= t.GetProperty("ProductName"); //获取属性值 object nameValue= name... 阅读全文
posted @ 2013-07-01 17:23 泉白水 阅读(1130) 评论(0) 推荐(0) 编辑