C#json转换成字典类型
string ProductDetails = "{\"size\":\"10\", \"weight\":\"10kg\"}"; Dictionary<string, string> ProductDetailList= JsonConvert.DeserializeObject<Dictionary<string, string>>(ProductDetails); foreach (var item in ProductDetailList) { Console.WriteLine(item.Key + " " + item.Value); }