Get or set the value with the specified key in CSharp
Description
The following code shows how to get or set the value with the specified key.
Example
using System;// w ww . j a v a2 s . c o m
using System.Collections;
using System.Collections.Specialized;
public class SamplesStringCollection {
public static void Main() {
OrderedDictionary myOrderedDictionary = new OrderedDictionary();
myOrderedDictionary.Add("testKey1", "testValue1");
myOrderedDictionary.Add("testKey2", "testValue2");
myOrderedDictionary.Add("keyToDelete", "valueToDelete");
myOrderedDictionary.Add("testKey3", "testValue3");
Console.WriteLine( myOrderedDictionary["keyToDelete"]);
}
}
The code above generates the following result.