What is the best .NET type for collections where each key can have multiple values?

前端 未结 4 896
隐瞒了意图╮
隐瞒了意图╮ 2021-02-15 23:34

I have one key but different values for that key. I tried HashTable but I don\'t think that is the right way of doing it.

I\'ll explain in detail what the requirement i

4条回答
  •  孤独总比滥情好
    2021-02-15 23:47

    If both your key and values are string you may want to use NameValueCollection.

    NameValueCollection class stores multiple string values under a single key. Acording to MSDN, this class can be used for headers, query strings and form data.

提交回复
热议问题