一般型別 泛型型別

ArrayList <=> List<> Queue <=> Queue<> Stack <=> Stack<> Hashtable <=> Dictionary<> StoredList <=> StoredList<> ListDictionary <=> Dictionary<> HybridDictionary <=> Dictionary<> OrderedDictionary <=> Dictionary<> SortedDictionary <=> StoredDictionary<> NameValueCollection <=> Dictionary<> DictionaryEntry <=> KeyValPair<> StringCollection <=> List<> StringDictionary <=> Dictionary<>

Dictionary 新增

Dictionary dataCollection = new Dictionary(); dataCollection.Add("1", "item01"); dataCollection.Add("2", "item02"); dataCollection.Add("3", "item03");

Dictionary 修改

dataCollection["3"] = "item000003";

Dictionary 刪除

dataCollection.Remove("2");

Dictionary 搜尋

var result = dataCollection.Where(x => x.Key == "3").Single();