Read and Parse a Json File in C#

Situation :  when you get JSON from source, it can be any source or JSON return by any service and you want to get data from JSON or want to access any retrive particluar data value from JSON

 

Here requiredfield is field

 

dynamic stuff = Newtonsoft.Json.JsonConvert.DeserializeObject(res);
         string RequiredData = stuff["requiredfield"].Value;  

if you are getting value with result

dynamic stuff = Newtonsoft.Json.JsonConvert.DeserializeObject(res);
         string RequiredData = stuff["result"]["requiredfield"].Value;        
Updated: April 18, 2017 — 1:08 PM

Leave a Reply

Your email address will not be published. Required fields are marked *

2 + 5 =


Tech Contents © 2016
Inline
Inline