Example

using System;
using System.Collections;
namespace Samples
{
  public class DictionaryEntrySample
  {
    public static void Main()
    {
      Hashtable t = new Hashtable();
      t.Add("damien", "maire");
      t.Add("mark", "sacha");
      t.Add("brad", "tamara");
      foreach(DictionaryEntry d in t)
      {
        Console.WriteLine("Key: {0} Value: {1}",
                          d.Key, d.Value);
      }
    }
  }
}
The output is
Key: damien Value: maire
Key: mark Value: sacha
Key: brad Value: tamara

Get .NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.