using System.Reflection;
ReflectClass r = new ReflectClass();
Type type = r.GetType();
//获取公有属性
PropertyInfo[] propertyInfo = type.GetProperties();
foreach (PropertyInfo p in propertyInfo) {
Console.Write(p.Name + " ");
}
通过Type类的GetProperties方法获取类的公有属性信息