zoukankan      html  css  js  c++  java
  • 如何去遍历对象中的所有的属性值

     //本函数是使用了反射来实现访问对象的属性值的函数
    //using System.Reflection;
     private void GetObjectPropertyValue(clsUser user)
    {
            Type t = user.GetType();
            foreach (PropertyInfo pi  in t.GetProperties())
            {
                Response.Write( pi.Name + "---" + pi.GetValue(user,null) + "<br>");
            }
    }
          
      

  • 相关阅读:
    python re模块
    python
    python
    Django学习手册
    Django学习手册
    前端
    前端
    Django学习手册
    前端
    Database学习
  • 原文地址:https://www.cnblogs.com/zijinguang/p/1123487.html
Copyright © 2011-2022 走看看