RT

解决方案 »

  1.   

    var result =
      from n in ht.Cast<DictionaryEntry>()
      where n.Key=="X"
      select n;
      

  2.   

    Hashtable hTable =new Hashtable();
    hTable.Add("key","value");
       IDictionaryEnumerator mIDE = hTable.GetEnumerator();
            while (mIDE.MoveNext())
             {
                Console.WriteLine("{0}:{1}", mIDE.Key, mIDE.Value);
            }http://hi.baidu.com/csy198811/item/93d0bd3e3c50cbdf6d15e985
      

  3.   

    我想要获取一个特定的key对应的值  比如key=“AA”  我想要的是“AA”对应的值,并且赋值给一个变量
      

  4.   


                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
      

  5.   

    string myString = hashTable["AA"].toString();//myString="value1"
      

  6.   

    1楼改改就可以了     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;
      

  7.   

    直接用啊,int value=(int)hashTable["AA"];
      

  8.   

    直接这样 
    string Value=ht["AA"].ToString();
      

  9.   

    HashTable的用法参考
    MSDN: http://msdn.microsoft.com/zh-cn/library/system.collections.hashtable.aspx