Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 627 Bytes

ReadJson.md

File metadata and controls

16 lines (13 loc) · 627 Bytes

Read JSON from a file using JObject

This sample reads JSON from a file into a Argon.JObject.

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

// read JSON directly from a file
using var file = File.OpenText(@"c:\videogames.json");
using var reader = new JsonTextReader(file);
var o2 = (JObject) JToken.ReadFrom(reader);

snippet source | anchor