Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you parse a JSON file using JSON.net

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

like image 850
user972616 Avatar asked Mar 04 '12 04:03

user972616


1 Answers

    using Newtonsoft.Json;

    //..

    JsonSerializer se = new JsonSerializer();
    object parsedData = se.Deserialize(reader);
like image 55
Serj-Tm Avatar answered Oct 17 '22 08:10

Serj-Tm