[C#/General] Dictionary<TKey,TValue> 예제.


[C#/General] Dictionary<TKey,TValue> 예제.

using System.Collections; public class Example { public static void Main() { Dictionary dicProgram = new Dictionary(); // dictionary에 key/value 추가합니다. dicProgram.Add("red", "red.exe"); dicProgram.Add("blue", "blue.exe"); dicProgram.Add("gray", "gray.exe"); dicProgram.Add("black", "black.exe"); // txt로 이미 추가된 Key 가 있으므로 Exception 처리됩니다. try { dicProgram.Add("txt", "winword.exe"); } catch (Argumen..


원문링크 : [C#/General] Dictionary<TKey,TValue> 예제.