//HashTable類表示一個鍵(Key)/值(Value)對的集合
//示例
using System;
using System
using System
using System
using System
namespace ConsoleApplication
{
public class ContractorTest
{
public static void Main()
{
Hashtable currencies = new Hashtable();
currencies
currencies
currencies
Console
Console
}
}
}
//示例
using System;
using System
using System
using System
using System
namespace ConsoleApplication
{
public class ContractorTest
{
public static void Main()
{
student stu
stu
stu
student stu
stu
stu
Hashtable ht = new Hashtable();
ht
ht
//第一種方法
//for (int i =
//{
// student stu = (student)ht[i];
// Console
//}
//第二種方法
IDictionaryEnumerator ide = ht
while (ide
{
DictionaryEntry destu = (DictionaryEntry)ide
//Console
student stu = (student)destu
Console
}
Console
}
}
From:http://tw.wingwit.com/Article/program/net/201311/12574.html