using System; using System.IO; using ln.json; namespace json.test { class MainClass { static string[] sources = { "\"I am a string\"", "{ \"me\" : \"is a string too\"}", "[ \"this\", \"is\", \"an\", \"array\" ]" }; public static void Main(string[] args) { JSONObject json = new JSONObject() .Add("version", new JSONNumber(123.456)) .Add("text", new JSONString("Ich bin ein Text! Lächerlich, oder?")) .Add("Obst",new JSONArray() .Add(new JSONString("Apfel")) .Add(new JSONString("Birne")) .Add(new JSONString("Zwetschge")) .Add(JSONNull.Instance) .Add(JSONTrue.Instance) .Add(JSONFalse.Instance) ) ; Console.WriteLine(json.ToString()); JSONValue json2 = JSONParser.Parse(json.ToString()); Console.WriteLine(json2.ToString()); JSONValue value = JSONParser.Parse(File.ReadAllText("test.json")); Console.WriteLine(""); Console.WriteLine("test.json file:"); Console.WriteLine("PARSED: {0}",value.ToString()); } } }