You can't do it with dictionary as it has no notion of order. Instead, use
NameValueCollection Class[
^] wihch can be accessed either with the key or with the index.e.g.
using System;
using System.Collections.Specialized;
public class Program
{
public static void Main()
{
NameValueCollection grade = new NameValueCollection();
grade.Add("excellent", "80");
grade.Add("good", "60");
grade.Add("average", "50");
grade.Add("fail", "40");
Console.WriteLine("Before: " + grade[3]);
grade.Remove("good");
grade.Add("good","60");
Console.WriteLine("After: " + grade[3]);
}
}
The outcome:
Before: 40
After: 60