0
我创建了一个HashSet对象的HashSet对象检索数据:从类型列表<string>
HashSet<List<string>> objHS = new HashSet<List<string>>();
,然后我动态地创建多个列表即(List<string> lst = new List<string>())
。
我可以在objHS中添加这些列表,例如(objHS.Add(lst))
。现在,由于有多个 列表,它们中的每一个都将具有索引号。在objHS。我用循环所以,我可以跟踪列表。这是我面临的问题,我无法从objHS中检索这些列表的值。
代码: -
for (int intlstcols = 0; intlstcols < intCols; intlstcols++)
{
List<string> lstCommon = new List<string>();
for (int intlstrows = 0; intlstrows < intRows; intlstrows++)
{
lstCommon.Add(sheetEntries[intlstrows, intlstcols]);
}
objHS.Add(lstCommon);
}
如果您发布了代码段,它将有助于人们更好地帮助您。 – Aravind 2011-05-23 06:53:17