Serialize All The Objects for .Net

//
// Reference System.Json.dll
//

using System.Json

// Serialize
string json = JSON.Serialize(new App(){ Package = "System.Json.Test.App", Version = "1.0(beta)", Build = 123 });

// Deserialize
App app = JSON.Deserialize<App>(json);

JSONObject jsonObject = new JSONObject(json);
string package = jsonObject.GetString("Package");
string version = jsonObject.GetString("Version");
long build = jsonObject.GetLong("Build");

Last edited Feb 24, 2013 at 3:30 PM by Joewoo, version 2