赞
踩
C#Dictionary排序:
1、升序
Dictionary<int, CustmonizedClass> dic1_SortedByKey = dic1.OrderBy(p=>p.Key).ToDictionary(p => p.Key, o => o.Value);
2、降序
Dictionary<int, CustmonizedClass> dic1_SortedByKey = dic1.OrderByDescending(p => p.Key).ToDictionary(p => p.Key, o => o.Value);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。