Mega Code Archive

 
Categories / C# / Collections Data Structure
 

For each KeyValuePair

using System; using System.Collections.Generic; public class Example {     public static void Main()     {         Dictionary<string, string> openWith = new Dictionary<string, string>();         openWith.Add("A", "a");         openWith.Add("B", "b");         openWith.Add("C", "c");                  foreach( KeyValuePair<string, string> kvp in openWith )         {             Console.WriteLine("Key = {0}, Value = {1}",                  kvp.Key, kvp.Value);         }    } }