获取类的属性名和值

            NormalModel model =new Normal(){Id="001",Name="dp"};
       Type type = model.GetType(); //获取类型 foreach (PropertyInfo pi in type.GetProperties()) { result += pi.Name + "=" + pi.GetValue(model, null) + "&"; }
原文地址:https://www.cnblogs.com/Med1tator/p/6387163.html