I'm trying to parse some JSON data with Json.Net. Here is my data:
[
{
"UIDClan": "1",
"UIDKnjiga": "1",
"Naslov": "Title1",
"DatumZaKada": "2013-08-09 00:00:00",
"DatumIstekRez": null,
"Spremno": "0"
},
{
"UIDClan": "1",
"UIDKnjiga": "2",
"Naslov": "Title2",
"DatumZaKada": "2013-08-08 00:00:00",
"DatumIstekRez": null,
"Spremno": "0"
},
{
"UIDClan": "1",
"UIDKnjiga": "3",
"Naslov": "Title3",
"DatumZaKada": "2013-08-09 00:00:00",
"DatumIstekRez": "2013-10-09 00:00:00",
"Spremno": "1"
}
]
With this piece of code i want to extract UIDClan data:
JObject o = JObject.Parse(s);
Console.WriteLine(o["UIDClan"]);
The error is
Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path '', line 1, position 1.
I've checked with JSONLint and it's valid.
The examples that I found doesn't start with [.
Am I doing something wrong?
question from:
https://stackoverflow.com/questions/18688261/json-net-error-reading 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…