Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Bringing JSON to C# in a way that is familiar to JavaScript developers.
C#
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Console Test
JSONObject
Test
JSONObject.sln
JSONObject.sln.VisualState.xml
JSONObject.suo
README
TestResult.xml

README

The Test folder has examples of use.

Let's you take a JSON string and turn it into a .NET object.

Example:

string raw = "[{\"id\":50,\"event_id\":8,\"title\":\"Meet Bob!\",\"description\":\"Come see Bob in person! One day only!\",\"cost\":\"Free!\",\"requirements\":\"Must be 21 or over.\",\"slots\":\"3\",\"allDay\":false,\"start\":\"2009-08-20T06:00:00Z\",\"end\":\"2009-08-20T08:00:00Z\"},{\"id\":51,\"event_id\":8,\"title\":\"Meet Bob!\",\"description\":\"Come see Bob in person! One day only!\",\"cost\":\"Free!\",\"requirements\":\"Must be 21 or over.\",\"slots\":\"3\",\"allDay\":false,\"start\":\"2009-08-20T09:00:00Z\",\"end\":\"2009-08-20T10:00:00Z\"},{\"id\":52,\"event_id\":8,\"title\":\"Meet Bob!\",\"description\":\"Come see Bob in person! One day only!\",\"cost\":\"Free!\",\"requirements\":\"Must be 21 or over.\",\"slots\":\"3\",\"allDay\":false,\"start\":\"2009-08-20T12:00:00Z\",\"end\":\"2009-08-20T13:00:00Z\"},{\"id\":53,\"event_id\":8,\"title\":\"Meet Bob!\",\"description\":\"Come see Bob in person! One day only!\",\"cost\":\"Free!\",\"requirements\":\"Must be 21 or over.\",\"slots\":\"3\",\"allDay\":false,\"start\":\"2009-08-20T15:00:00Z\",\"end\":\"2009-08-20T16:00:00Z\"}]";

List<JSONObject> list = JSONObject.parseJSONObjectArray(raw);

Console.WriteLine("Found " + list.Count + " items");
foreach (JSONObject item in list)
{
    Console.WriteLine("Found Object:");
    Console.WriteLine("\tid: " + item.intForKey("id"));
    Console.WriteLine("\title: " + item.stringForKey("title"));
    Console.WriteLine("\tstart: " + item.stringForKey("start"));
}

Something went wrong with that request. Please try again.