对某个类的属性进行遍历

using System.Reflection;
 
 
 
 
Type t = typeof(A);
foreach(PropertyInfo pi in t.GetProperties(BindingFlags.Instance | BidngFlags.Public))
{
    Console.WriteLine(pi.Name);
}

 

posted on 2013-11-28 15:44  中子持心  阅读(234)  评论(0编辑  收藏  举报

导航