using
System;
using
System.Collections;
using
System.Collections.Specialized;
class
GFG {
public
static
void
Main()
{
OrderedDictionary myDict =
new
OrderedDictionary();
myDict.Add(
"key1"
,
"value1"
);
myDict.Add(
"key2"
,
"value2"
);
myDict.Add(
"key3"
,
"value3"
);
myDict.Add(
"key4"
,
"value4"
);
myDict.Add(
"key5"
,
"value5"
);
ICollection keyCollection = myDict.Keys;
String[] myKeys =
new
String[myDict.Count];
keyCollection.CopyTo(myKeys, 0);
for
(
int
i = 0; i < myDict.Count; i++) {
Console.WriteLine(myKeys[i]);
}
}
}