Remark : Dictionary 구조체 이해
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
static void Main(string[] args) { Dictionary<string, string> DicData = new Dictionary<string, string>(); DicData.Add("A", "A001"); DicData.Add("B", "A002"); DicData.Add("C", "A003"); DicData.Add("D", "A004"); DicData.Add("F", "A005"); foreach (KeyValuePair<string, string> item in DicData) { Console.WriteLine("{0},{1}", item.Key, item.Value); } Console.WriteLine("ok"); Console.ReadLine(); } |
1 2 3 4 5 6 7 8 |
A,A001 B,A002 C,A003 D,A004 F,A005 ok |
Key 중복 불가
이름 | 값 | 형식 | |
---|---|---|---|
▶ | $exception | {“동일한 키를 사용하는 항목이 이미 추가되었습니다.”} | System.ArgumentException |
