在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
tatic void Main(string[] args) { //先反序列化看看 string json = "{\"name\": true,\"age\": \"success\",\"hobby\": [{\"obj1\": \"6\",\"obj2\": \"7\",\"obj3\": \"10\"}, {\"obj1\": \"6\",\"obj2\": \"7\",\"obj3\": \"10\"}]}"; var q = JsonConvert.DeserializeObject<dynamic>(json); Console.WriteLine(q.name); //只反序列化hobby为List<Test> JObject jobj = JObject.Parse(json); string Data = jobj["hobby"].ToString(); var v = JsonConvert.DeserializeObject<List<Test>>(Data); Console.WriteLine(v[0].obj2); Console.ReadLine(); } public class Test { public string obj1 { get; set; } public string obj2 { get; set; } public string obj3 { get; set; } }
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论