Answers for "how to use json files with c#"

C#
8

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);
}
Posted by: Guest on July-24-2020

Code answers related to "how to use json files with c#"

C# Answers by Framework

Browse Popular Code Answers by Language