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);
}
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);
}