Dictionary 排序

          var collection = charts.OrderByDescending(item => item.Value).Take(10).ToList();
            Dictionary<string, int> dictionary = new Dictionary<string, int>();
            foreach (var item in collection)
            {
                dictionary.Add(item.Key, item.Value);
            }

posted @ 2010-12-21 17:19  Kong, Star  阅读(278)  评论(0编辑  收藏  举报