|  | Parsing JSON | 
LINQ to JSON has methods available for parsing JSON from a string or loading JSON directly from a file.
 Parsing JSON text
Parsing JSON textJSON values can be read from a string using Parse(String).
string json = @"{ CPU: 'Intel', Drives: [ 'DVD read/writer', '500 gigabyte hard drive' ] }"; JObject o = JObject.Parse(json);
string json = @"[ 'Small', 'Medium', 'Large' ]"; JArray a = JArray.Parse(json);
 Loading JSON from a file
Loading JSON from a fileJSON can also be loaded directly from a file using ReadFrom(JsonReader).
using (StreamReader reader = File.OpenText(@"c:\person.json")) { JObject o = (JObject)JToken.ReadFrom(new JsonTextReader(reader)); // do stuff }
 See Also
See Also