using System; using System.Collections; using System.Collections.Generic; class SortedListExample { static int Main() { IDictionary collection = new SortedList(); collection.Add("Alex","7274 1676"); collection.Add("Amanda","7326 1876"); collection.Add("Andy","01646 690 483"); collection.Add("Angela","7274 8173"); collection.Add("Arian","011895 542 406"); collection.Add("Bob","8743 4828"); collection.Add("Brixton_Rec","7926 9779"); collection.Add("Cable","7207 5288"); collection.Add("Cable_faults","0800 068 1374"); collection.Add("Caroline","7271 0763"); collection.Add("Caroline_2","7274 3949"); collection.Add("Charlotte","7274 4844"); collection.Add("Claire","8692 3829"); collection.Add("Clare","8671 3238"); Console.WriteLine( " Number of entries: {0}", collection.Count ); Console.WriteLine( "\t-KEY-\t\t-VALUE-" ); foreach ( DictionaryEntry d in collection) { Console.WriteLine(" \t {0} \t\t {1}", d.Key, d.Value); } Console.WriteLine(); string key; key=System.Console.ReadLine(); if (collection.Contains(key)) Console.WriteLine(" Phone number = {0} " , collection[key]); return 0; } }//