C# - parsing json formatted data into nested hashtables

后端 未结 4 649
日久生厌
日久生厌 2020-12-17 04:09

I’m trying to work with some json formatted data in C#, but, I’m having some problems determining the proper way to approach the problem. My issue is that the json formatte

4条回答
  •  甜味超标
    2020-12-17 04:43

    In .NET, you have the JsonArray, which allows you to load up and parse the JSON data. It creates an array of JsonValue and it is completely nested based on the JSON data it parses.

    If you specifically need Hashtable, you could translate the data from JsonArray, though Hastable is all but deprecated in favor of Dictionary.

    Josh Holmes has a pretty good "getting started" post about JSON in .NET: http://www.joshholmes.com/blog/2009/01/20/PlayingWithJSON.aspx

提交回复
热议问题