HashTable.Keys : HashTable « System.Collections « C# / C Sharp by API






HashTable.Keys

  
using System; 
using System.Collections; 
 
class HashtableDemo { 
  public static void Main() { 
    Hashtable ht = new Hashtable(); 
     
    
    ht.Add("a", "A"); 
    ht.Add("b", "B"); 
    ht.Add("c", "C"); 
    ht.Add("e", "E"); 
 
    // Get a collection of the keys. 
    ICollection c = ht.Keys; 
 
    foreach(string str in c) 
      Console.WriteLine(str + ": " + ht[str]); 
  } 
}

   
    
  








Related examples in the same category

1.HashTable.Remove
2.Hashtable.Add
3.Hashtable.ContainsKey
4.Hashtable.ContainsValue
5.Hashtable.Keys.CopyTo
6.Hashtable.Synchronized
7.Hashtable.Values
8.Hashtable.Values.CopyTo