如题

解决方案 »

  1.   

    Hashtable ht = new Hashtable();    ht.put("one",new Integer(1));    ht.put("two",new Integer(2));    Enumeration en = ht.elements();    while(en.hasMoreElements()){    System.out.println((Integer)en.nextElement());    }
      

  2.   

    用: 
    foreach (DictionaryEntry de in htb)来遍历
      

  3.   

    foreach( DictionaryEntry de in hashTable) 

     console.WriteLine("Key -- {0}; Value --{1}.", de.Key, de.Value); 

      

  4.   

    HashTable xxHash;foreach(DirectoryEntry entry in xxHash)
    {}
      

  5.   

    foreach(DirectoryEntry entry in xxHash)
      

  6.   

    foreach(DictionaryEntry de in hash) 

           string dept = de.Key.ToString().Trim(); 
           string ids = de.Value.ToString().Trim(); 
    }
      

  7.   

    Hashtable ht = new Hashtable();
    foreach (DictionaryEntry de in ht)
    {
        object theKey = de.Key;
        object theValue = de.Value;
    }
    //or:
    foreach (object theKey in ht.Keys)
    {
        object theValue = ht[theKey];
    }
      

  8.   

    foreach (DictionaryEntry de in htb)来遍历