Click or drag to resize
Json.NETCreate JSON manually
 

This sample creates JObject and JArray instances one at a time programatically.

Sample
Usage
 1JArray array = new JArray();
 2array.Add("Manual text");
 3array.Add(new DateTime(2000, 5, 23));
 4
 5JObject o = new JObject();
 6o["MyArray"] = array;
 7
 8string json = o.ToString();
 9// {
10//   "MyArray": [
11//     "Manual text",
12//     "2000-05-23T00:00:00"
13//   ]
14// }