111,092
社区成员




static void Main(string[] args)
{
Class2 c2 = new Class2();
PropertyInfo[] pis = c2.GetType().GetProperties();
}
static void Main(string[] args)
{
Class2 c2 = new Class2();
PropertyInfo[] pis = c2.GetType().GetProperties();
}
//以c2为你拿到了的class2对象
Type t=c2.gettype().basetype;
PropertyInfo[] ps = t.GetProperties();
foreach (PropertyInfo p in ps){
//这里面应该可以循环出来显示实现接口的属性}