Parse and Extract Attributes from JSON

后端 未结 3 2029
终归单人心
终归单人心 2021-01-24 05:16

I have a large JSON file similar to this:

{
   \"data\":[
      {
         \"attribution\":null,
         \"tags\":[
            \"thenight2\"
         ],
               


        
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-24 06:03

    I have used the JSON class in System.Web.Helpers Namespace (.Net 4.0) previously and it works well for me. You are able to refer to arrays dynamically. It should be used similarly to this:

    dynamic myJson = Json.Decode(myJsonString);
    foreach (var url in myJson.data.images.standard_resolution){
    //DO SOMETHING
    }
    

提交回复
热议问题