华山轮贱

c# 类的历遍和历遍操作

        string id = Request.Form["id"];
        string type = Request.Form["type"];
        string info = Request.Form["info"];
        usinfo u1 = nosql_usinfo.get(id);
        Type t = u1.GetType();
        System.Reflection.PropertyInfo[] PropertyList = t.GetProperties();
        foreach (System.Reflection.PropertyInfo item in PropertyList)
        {
            string name = item.Name;
            object value = item.GetValue(u1, null);
            if(type==name)
            {
                item.SetValue(u1,info,null); 
            }
        }

  

posted on 2018-07-18 17:01  华山轮贱  阅读(205)  评论(0编辑  收藏  举报

导航