110,532
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
class Program
{
static Dictionary<string, IList<object>> list = new Dictionary<string, IList<object>>();
static void Main()
{
list["a"] = new List<object>();
list["a"].Add(true);
list["a"].Add("OK");
foreach (KeyValuePair<string,IList<object>> k in list)
{
if (k.Key == "a")
{
k.Value.Add(12345);
break;
}
}
foreach (object o in list["a"])
{
Console.WriteLine(o);
}
}
}
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
Dictionary<string,List<object>> d = new Dictionary<string,List<object>>();
d["a"] = new List<object>();
d["a"].Add(1);
d["a"].Add("OK");
d["a"].Add(false);
foreach (object o in d["a"])
{
Console.WriteLine(o);
}
}
}