using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Dictionary<int, string> test = new Dictionary<int, string> { };
test.Add(0,"000");
test.Add(4, "444");
test.Add(2, "222");
test.Add(6, "666");
Dictionary<int, string> dic1Asc = test.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
C# Dictionary根据Key排序
于 2016-12-08 11:20:55 首次发布