iterate through dictionary c#

48

.net loop through dictionary -

foreach (KeyValuePair item in myDictionary)
{
    MessageBox.Show(item.Key + "   " + item.Value);
}

foreach dictionary c# -

foreach(KeyValuePair<string, string> entry in myDictionary)
{
    // do something with entry.Value or entry.Key
}

Comments

Submit
0 Comments