我有using (StreamWriter sw = new StreamWriter("CDriveDirs.txt"))
{
sw.WriteLine(dir.Name);
}
。我想声明Dictionary<string,string>
的名称和编号取决于字典的键。
List<List<string>>
我想像var assetTypeName = assetType.Select(type => type.Name).ToList();
List<List<string>> exGeneral;
List<List<string>> exTablet;
List<List<string>> exLaptop;
List<List<string>> exPhone;
一样创建List<List<string>>
,其名称和编号取决于assetTypeName。
答案 0 :(得分:0)
这应该这样做:
var dic = new Dictionary<int,string>();
dic.Add(1,"one");
dic.Add(2,"two");
var keys = dic.Keys.ToList();
var values = dic.Values.ToList();