.NET的JSON库 JSON.NET

openkk 13年前
     <p>这是一个.NET框架使用的 JSON 解析和操作的类库。</p>    <h4>功能特性:</h4> -Flexible JSON serializer to convert .NET objects to JSON and back again    <br /> -LINQ to JSON for manually reading and writing JSON    <br /> -高性能,比.Net内置的JSON序列化功能更快。    <br /> -Writes indented, easy to read JSON    <br /> -支持JSON 与 XML 两种格式相互转换    <br /> -支持Silverlight 和 Windows Phone    <br />    <br />    <p>示例代码:</p>    <pre class="brush:c#; toolbar: true; auto-links: false;">Product product = new Product(); product.Name = "Apple"; product.Expiry = new DateTime(2008, 12, 28); product.Price = 3.99M; product.Sizes = new string[] { "Small", "Medium", "Large" };   string json = JavaScriptConvert.SerializeObject(product); //{ //  "Name": "Apple", //  "Expiry": new Date(1230422400000), //  "Price": 3.99, //  "Sizes": [ //    "Small", //    "Medium", //    "Large" //  ] //}   Product deserializedProduct = JavaScriptConvert.DeserializeObject     (json);</pre>    <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1324130165218" target="_blank">http://www.open-open.com/lib/view/home/1324130165218</a></p>    <p></p>