我想在单独的标签中的字典中显示值。我得到的解释是这样的:如何动态生成在字典中显示值的标签
Dictionary<string, int> counts = new Dictionary<string, int>();
foreach (string code in myCodeList)
{
if (!counts.ContainsKey(code))
{
counts.Add(code, 1);
}
else
{
counts[code]++;
}
}
//now counts contains the expected values
我想动态生成的标签,因为在counts
元素只能在运行时确定。
我没有得到你的代码,为什么不只是Label.Text = String.Concat(“,”,myList); – Cynede 2012-07-23 06:18:22