Maha

Maha

  • NA
  • 0
  • 326k

Using Directive

Aug 9 2013 11:28 AM
I wish to know whether there is any way to find out which using directive needs to a particular code.
For example following program is needed using System; and using System.Collections; using directives because it uses Hashtable and DictionaryEntry in the code.

using System;
using System.Collections;

class Program
{
static void Main()
{
// Create hashtable with some keys and values.
Hashtable hashtable = new Hashtable();

hashtable.Add(1, "one");
hashtable.Add(2, "two");
hashtable.Add(3, "three");

// Enumerate the hashtable.
foreach (DictionaryEntry entry in hashtable)
{
Console.WriteLine("{0} = {1}", entry.Key, entry.Value);
}
Console.ReadKey();
}
}
/*
3 = three
2 = two
1 = one
*/


Answers (5)