对某个类的属性进行遍历

using System.Reflection;
 
 
 
 
Type t = typeof(A);
foreach(PropertyInfo pi in t.GetProperties(BindingFlags.Instance | BidngFlags.Public))
{
    Console.WriteLine(pi.Name);
}
原文地址:https://www.cnblogs.com/hbhzz/p/3447854.html