C# SortedList key 排序

SortedList sl = new SortedList();
            sl["c"] = 41;
            sl["a"] = 42;
            sl["d"] = 11;
            sl["b"] = 13;
            //排序
            foreach (DictionaryEntry element in sl)
            {
                string s = (string)element.Key;
                int i = (int)element.Value;
                this.richTextBox1.AppendText("{0},{1}" + s + i + "\n");
                //Console.WriteLine("{0},{1}", s, i);
            }
posted @ 2010-01-25 23:24  vhtt  阅读(660)  评论(0)    收藏  举报