1.ArrayList类
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ConsoleApplication1

2.Stack类
栈,后进先出。push方法入栈,pop方法出栈。
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ConsoleApplication1

3.Queue类
队列,先进先出。enqueue方法入队列,dequeue方法出队列。
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ConsoleApplication1

4.Hashtable类
哈希表,名-值对。类似于字典(比数组更强大)。哈希表是经过优化的,访问下标的对象先散列过。如果以任意类型键值访问其中元素会快于其他集合。GetHashCode()方法返回一个int型数据,使用这个键的值生成该int型数据。哈希表获取这个值最后返回一个索引,表示带有给定散列的数据项在字典中存储的位置。
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ConsoleApplication1

5.SortedList类
与哈希表类似,区别在于SortedList中的Key数组排好序的。
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ConsoleApplication1

6.NameValueCollection类
官方给NameValueCollection定义为特殊集合一类,在System.Collections.Specialized下。
System.Collections.Specialized下还有HybridDicionary类,建议少于10个元素用HybridDicionary,当元素增加会自动转为HashTable。
System.Collections.Specialized下还有HybridDicionary类,字符串集合。
System.Collections.Specialized下还有其他类大家可以各取所需!
言归正转主要说NameValueCollection,HashTable 和 NameValueCollection很类似但是他们还是有区别的,HashTable 的KEY是唯一性,而NameValueCollection则不唯一!
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
namespace ConsoleApplication1