谁能告诉我如何在哈希表中搜索特定键并将相应的值放到变量中(例如,键和值都来自 point 类)
我添加如下值:
Hashtable Hash = new Hashtable();
Hash.Add(new Point(Po.X - 1, Po.Y), new Point(Po.X, Po.Y));
请您参考如下方法:
您可以使用以下内容:
Point value;
if (Hash.ContainsKey(YourKey))
{
value = (Point)Hash[YourKey];
}
