As mentioned,Please tell me the essence of JToken and JsonToken in Json.Net.
I can not distinguish the meaning about them clearly.
I am anxious for your answer! many thanks!
The JToken hierarchy looks like this: JToken - abstract base class JContainer - abstract base class of JTokens that can contain other JTokens JArray - represents a JSON array (contains an ordered list of JTokens) JObject - represents a JSON object (contains a collection of JProperties) JProperty - represents a JSON ...
JToken represents any possible token in a JSON file. If you have some JSON and don't know in advance what might be inside, you can parse it with JToken. Parse() and get a result as long as the JSON is valid.
JToken. Creates a JArray from an object. The object that will be used to create JArray. The JsonSerializer that will be used to read the object.
The JObject type exposes the following members. Initializes a new instance of the JObject class. Initializes a new instance of the JObject class with the specified content. Initializes a new instance of the JObject class with the specified content.
JToken is the abstract base class of JObject, JArray, JProperty, and JValue, which represent pieces of JSON data after they have been parsed.
JsonToken is an enum that is used by JsonReader and JsonWriter to indicate which type of token is being read or written.
You can find more information in the Json.Net API reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With