//定义一个Hashtable
public static Hashtable hstFileInfo = new Hashtable();
//给Hashtable添加数据
if (!hstFileInfo.Contains(ID))
{
hstFileInfo.Add(ID, Name);
}
//循环Hashtable,获取Key和Value
foreach (DictionaryEntry fl in hstFileInfo) //获取文件
{
string Key = fl.Key.ToString(); //Key
string Value = (string)fl.Value.ToString(); //Value
}