asp.net:如何在不使用密钥的情况下访问字典的每个元素?

Mad*_*hik 3 .net indexing dictionary

我想用int索引访问我的字典Dictionary的每个对象.如何做到这一点.

Bin*_*ier 6

Dictionary<KeyType, ValueType> myDictionary = . . .


foreach(KeyValuePair<KeyType, ValueType> item in myDictionary)
{
   Console.WriteLine("Key={0}: Value={1}", item.Key, item.Value);
}
Run Code Online (Sandbox Code Playgroud)