c#遍历一个对象中所有的属性和值
SpDictItem sp = GetCFHObject.GetSpItem("655"); PropertyInfo[] propertys = sp.GetType().GetProperties(); foreach (PropertyInfo pinfo in propertys) { Response.Write("<br>" + pinfo.Name + "," + pinfo.GetValue(sp, null) + "<br>"); }
SpDictItem sp = GetCFHObject.GetSpItem("655"); PropertyInfo[] propertys = sp.GetType().GetProperties(); foreach (PropertyInfo pinfo in propertys) { Response.Write("<br>" + pinfo.Name + "," + pinfo.GetValue(sp, null) + "<br>"); }