相关疑难解决方法(0)

C#中使用MultiDimensional键的Hashtable

我基本上是在寻找一种方法来使用c#中的二维类型键来访问哈希表值.

最终我可以做这样的事情

HashTable[1][false] = 5;
int a = HashTable[1][false];
//a = 5
Run Code Online (Sandbox Code Playgroud)

这就是我一直在尝试的......没有用

Hashtable test = new Hashtable();
test.Add(new Dictionary<int, bool>() { { 1, true } }, 555);
Dictionary<int, bool> temp = new Dictionary<int, bool>() {{1, true}};
string testz = test[temp].ToString(); 
Run Code Online (Sandbox Code Playgroud)

c# dictionary hashtable

62
推荐指数
7
解决办法
7万
查看次数

标签 统计

c# ×1

dictionary ×1

hashtable ×1