【发布时间】:2017-08-07 13:26:21
【问题描述】:
我想使用DictionaryEntry 解析我的Hashtable 并读取DictionaryEntry 对象的值(如果值为List<string>)
下面是示例代码。
Hashtable strResx = new Hashtable();
List<string> allDetails = new List<string>();
allDetails.Add("val0");
allDetails.Add("val1");
strResx.Add(1, allDetails);
strResx.Add(2, allDetails);
strResx.Add(3, allDetails);
foreach (DictionaryEntry entry in strResx)
{
string value0 = entry.Value.ToString();
string value1 = entry.Value.ToString();
someFunction(value0, , value1);
}
我真的很困惑如何对entry.Value.ToString(); 进行索引
类似entry.Value[0].ToString(); 和entry.Value[1].ToString();
请帮助。
【问题讨论】:
标签: c# asp.net generics collections