狮子座男

导航

得到一个Object的属性

        private static object GetPropertyValue(object obj, string property)
        {
            System.Reflection.PropertyInfo propertyInfo =  obj.GetType().GetProperty(property);
            return propertyInfo.GetValue(obj, null);
        }        

 

posted on 2014-06-20 10:13  狮子座男  阅读(227)  评论(0编辑  收藏  举报