I’m using JSON.NET to de-serialize some JSON from a web service. I’m wanting to detect if a certain token is present and then act on that.
JToken token = JObject.Parse(JsonData);
I’m using the above to de-serialize the data, i’ve then tried the following
if (((string)token.SelectToken("tokenname")) != null)
{
Debug.WriteLine("found");
}
else
{
Debug.WriteLine("not found");
}
each time it returns not found. Any idea’s? thanks
I have been doing the following:
(I’m assuming the JsonData is a string)