VS2005中 如何通过Key来对dictionary 排序

解决方案 »

  1.   

    2楼,我说的是VS05,有Lamda吗?一楼能说说怎么用吗?
      

  2.   

    使用
    SortedDictionary<TKey, TValue> 
    详见MSDN
    http://msdn.microsoft.com/zh-cn/library/f7fta44c.aspx
      

  3.   

                string[] strs = new string[dic.Keys.Count];
                dic.Keys.CopyTo(strs, 0);
                Array.Sort(strs);
                Dictionary<string, string> s = new Dictionary<string, string>();
           
                foreach (string typeName in strs) {}