zoukankan      html  css  js  c++  java
  • 循环类里面的每一个属性

             

       Type type = typeof(类名);

                System.Reflection.PropertyInfo[] myPropertyInfo;
                myPropertyInfo = type.GetProperties();

                for (int i =0; i < myPropertyInfo.Length; i++)
                {
                         Amount amount= (Amount)myPropertyInfo[i].GetValue(Statictis, null);

                        amount.CDF= Math.Round(amount.CDF, 2);

                        myPropertyInfo[i].SetValue(Statictis, amount, null);
                    
                }
           

  • 相关阅读:
    OpenCV 简介
    无缝滚动
    Date 与 switch的运用
    js object(对象)
    arr.sort()排序方法
    删除
    评分
    延时提示框
    数字相加求和
    自定义右键菜单
  • 原文地址:https://www.cnblogs.com/panjun/p/2856088.html
Copyright © 2011-2022 走看看