How to add duplicate keys into the Dictionary

后端 未结 6 627
闹比i
闹比i 2021-01-31 17:37

I have some lines from text files that i want to add into the Dictionary.I am using Dictionary for the first time.While adding up starting lines it was Ok but suddenly i got err

6条回答
  •  后悔当初
    2021-01-31 18:27

    List< KeyValuePair < string, string>> listKeyValPair= new List< KeyValuePair< string, string>>();
    KeyValuePair< string, string> keyValue= new KeyValuePair< string, string>("KEY1", "VALUE1");
    listKeyValPair.Add(keyValue);
    

提交回复
热议问题