Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

reading a json file in c#

JObject o1 = JObject.Parse(File.ReadAllText(@"c:videogames.json"));

// read JSON directly from a file
using (StreamReader file = File.OpenText(@"c:videogames.json"))
using (JsonTextReader reader = new JsonTextReader(file))
{
    JObject o2 = (JObject)JToken.ReadFrom(reader);
}
Source by www.newtonsoft.com #
 
PREVIOUS NEXT
Tagged: #reading #json #file
ADD COMMENT
Topic
Name
8+6 =