iterate through the dictionary c# code example
Example 1: how to do a foreach loop in c# for dictionary
foreach (KeyValuePair<string, int> kvp in myDictionary)
{
print(kvp)
}
Example 2: .net loop through dictionary
foreach (KeyValuePair item in myDictionary)
{
MessageBox.Show(item.Key + " " + item.Value);
}