没明白!
public class MyClass
{
private Hashtable _data = new Hashtable();
public object this[object key] { get { return this._data[key]; } }
public void Foo()
{
foreach (DictionaryEntry entry in this._data)
{
Console.WriteLine(string.Format("Key: {0}; Value: {1}", entry.Key, entry.Value));
}
}
}