62,073
社区成员
发帖
与我相关
我的任务
分享
Type t = obj.GetType();
PropertyInfo[] properties = t.GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (PropertyInfo pi in properties)
{
Console.WriteLine("{0}:{1}", pi.Name, pi.GetValue(obj, null));
}