循环类里面的每一个属性
生活随笔
收集整理的這篇文章主要介紹了
循环类里面的每一个属性
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?????????
???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);
????????????????
??????????? }
???????
轉載于:https://www.cnblogs.com/panjun/archive/2013/01/11/2856088.html
總結
以上是生活随笔為你收集整理的循环类里面的每一个属性的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 斗牛犬好养吗(法牛犬好养吗怎么训练)
- 下一篇: 幻想大王奇遇记读后感300字