c# iterate through json

后端 未结 2 473
感动是毒
感动是毒 2021-01-29 03:04

Currently I am working on a soundcloud downloader in C#. With the help of the SoundCloud API I get a JSON string of a playlist, which includes a lot of information of the tracks

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-29 03:36

    You could try using Newtonsoft JSON Deserializer.

    For your case you could do something like this:

    1. Create a Track class with needed properties

    2. Apply DeserializeObject

      Track jsonObject = JsonConvert.DeserializeObject(json);
      
    3. Iterate over jsonObject

提交回复
热议问题