Enumerating a hash table collection : Hashtable : Collections Data Structure C# Source Code


Custom Search

C# Source Code » Collections Data Structure » Hashtable »

 

Enumerating a hash table collection









    


using System;
using System.Collections;

class Test{

  public static void Main() {
       Hashtable ht = new Hashtable(10);
    
       // Add strings to the hashtable associated with a
       // key value (integer).
    
       ht.Add( 100, "Z");
       ht.Add( 200, "A");
       ht.Add( 300, "B");
       ht.Add( 400, "S");
       ht.Add( 500, "G");
    
       foreach ( DictionaryEntry de in ht ) {
         Console.WriteLine( "Entry Key {0} Value {1}", de.Key, de.Value );
       }
  }
}


           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Collections Data Structure
» Hashtable