How do you parse a JSON file using JSON.net

user972616 picture user972616 · Mar 4, 2012 · Viewed 44k times · Source

I am trying to read a JSON file and parse it. I have this code for reading from my file

StreamReader re = new StreamReader("artists.json");
JsonTextReader reader = new JsonTextReader(re);

But how do I parse it now from reader so I can search data from the file?

I tried reading the documentation but couldn't find anything

Answer

Serj-Tm picture Serj-Tm · Mar 4, 2012
    using Newtonsoft.Json;

    //..

    JsonSerializer se = new JsonSerializer();
    object parsedData = se.Deserialize(reader);