How to parse json?

I use the Newtonsoft Json library to parse json, but I don't know how to use it. I parsed the string using JObject. When I bring the value of the JObject instance to the nearest window, I get the following: -

json
{
  "data": [
    {
      "id": "id",
      "from": {
        "name": "name",
        "id": "someotherid"
      },
      "name": "pic",
      "description": "desc",
      "link": "linktosite",
      "privacy": "everyone",
      "count": 1,
      "type": "normal",
      "created_time": "2010-10-22T14:54:32+0000",
      "updated_time": "2010-10-22T14:55:41+0000"
    },
    {
      "id": "id2",
      "from": {
        "name": "name",
        "id": "someotherid"
      },
      "name": "Profile Pictures",
      "link": "link",
      "privacy": "everyone",
      "count": 6,
      "type": "profile",
      "created_time": "2010-10-12T14:27:58+0000",
      "updated_time": "2011-01-01T18:38:14+0000"
    },
    {
      "id": "id3",
      "from": {
        "name": "name",
        "id": "829741958"
      },
      "name": "T",
      "link": "link",
      "privacy": "everyone",
      "count": 5,
      "type": "normal",
      "created_time": "2010-05-01T03:03:39+0000",
      "updated_time": "2010-05-01T03:19:13+0000",
      "comments": {
        "data": [
          {
            "id": "id",
            "from": null,
            "message": "message",
            "created_time": "2010-08-28T18:27:10+0000",
            "likes": 1
          }
        ]
      }
    }
  ],
  "paging": {
    "previous": "paginglink",
    "next": "otherpaginglink"
  }
}

    Count: 2
    Type: Object

What should I do next to have meaning from this assignment?

+3
source share
2 answers

I personally prefer JavaScriptSerializer for use with JSON in the .NET environment. By default, it will return the result of the dictionary, but can be used for analysis in a custom object (or you can use a dynamic data type).

Some other posts on SO with JSON and JavaScript Serializer as a theme

+3
source
+1

Source: https://habr.com/ru/post/1790613/


All Articles