Using System.Web.Script.Serialization.JavascriptSerializer to deserialize JSON - how to?

后端 未结 1 387
一个人的身影
一个人的身影 2020-12-28 22:59

Note: I posted a similar question, which was the ancestor of this question, as I was originally thinking of using JSON.NET to parse the JSON, but I\'m using the built-in

相关标签:
1条回答
  • 2020-12-28 23:46

    I tried with your example json / class, and the following works fine:

    List<Item> items = ser.Deserialize<List<Item>>(json);
    

    Is the actual code any different?

    (where json is the string - feel free to replace by ReadToEnd etc; or use WebClient.DownloadString, which is simpler)

    0 讨论(0)
提交回复
热议问题