.net loop through dictionary

C#
foreach(var item in myDictionary)
{
  foo(item.Key);
  bar(item.Value);
}foreach (KeyValuePair<string, int> kvp in myDictionary)
{
	print(kvp)
}foreach (KeyValuePair item in myDictionary)
{
    MessageBox.Show(item.Key + "   " + item.Value);
}

Source

Also in C#: