test_sortedlist1
Sorted List : with  Dictionary
Using :
  • sortedlist[1] = "Jan";
  • foreach (DictionaryEntry entry in sortedlist)
  • Console.WriteLine("{0}, {1}", entry.Key, entry.Value);
// Namespace Declaration
//File location : C:\BareBone_CSharp\Source_Code\Template
using System;
//csc test_sortedlist1.cs
using System.Collections;
// Program start class
namespace test_sortedlist1
{

class CsharpTemplate
{
// Main begins program execution.
public static void Main(string[] str1)
{
SortedList sortedlist = new SortedList();
sortedlist[1] = "Jan";
sortedlist[2] = "Feb";
sortedlist[3] = "Mar";

foreach (DictionaryEntry entry in sortedlist)
{
Console.WriteLine("{0}, {1}", entry.Key, entry.Value);
}
}
}
}
//