Although I have figured out how I can read the JSON file with Newtonsoft, but not how I can read the points. I would like to read all X, Y points. Whats the best way to do this? I have the whole JSON file "read" and how do I get now the individual points out?
This is a small extract from the JSON file:
{
"Points": [
{
"X": -3.05154,
"Y": 4.09
},
{
"X": -3.05154,
"Y": 3.977
}
],
"Rectangles": [
{
"XMin": -3.08154,
"XMax": 3.08154,
"YMin": -4.5335,
"YMax": 4.5335
}
]
}
JObject o1 = JObject.Parse(File.ReadAllText(@"C:\Users\user\Desktop\test.json"));
Koordinaten kor = new Koordinaten();
// read JSON directly from a file
using (StreamReader file = File.OpenText(@"C:\Users\user\Desktop\test.json"))
using (JsonTextReader reader = new JsonTextReader(file))
{
JObject o2 = (JObject)JToken.ReadFrom(reader);
}