示例:
新建一个类:
public class Lang { public string En; public string Ch; }
实例化并转为字典:
List<Lang> langs = new List<Lang>(); langs.Add(new Lang() { Ch = "书籍", En = "Book" }); langs.Add(new Lang() { Ch = "电影", En = "Film" }); var dict = langs.ToDictionary(x => x.Ch, x => x.En); var value = dict["书籍"];