110,539
社区成员
发帖
与我相关
我的任务
分享
Hashtable ht = new Hashtable();
ht.Add("AA", "AAValue");
ht.Add("BB", "BBValue");
ht.Add("CC", "CCValue");
ht.Add("DD", "DDValue");
var result = from n in ht.Cast<DictionaryEntry>()
where n.Key == "AA"
select n.Value;
Hashtable hashTable = new Hashtable();
hashTable.Add("key1", "value1");
ArrayList keyList = new ArrayList(hashTable.Keys);
for (int i = 0; i < keyList.Count; i++)
{
hashTable[keyList[i]] = "AA";
}
Console.WriteLine(hashTable["key1"]);//AA