我正在使用 C# 4.0。我想使用 IDictionary 存储(字符串,字符串)对。如下所示:
Dictionary<string, string> _tempDicData = new Dictionary<string, string>();
_tempDicData.Add("Hello", "xyz");
_tempDicData.Add("Hello", "aaa");
_tempDicData.Add("Hello", "qwert");
_tempDicData.Add("Hello", "foo");
_tempDicData.Add("Hello", "pqr");
_tempDicData.Add("Hello", "abc");
但出现错误:
An item with the same key has already been added.
那么如何在 IDictionary 中存储相同的密钥?