
很早就开始用James Newton 的 Json.Net 了,但到今天才知道它支持silverlight,原来作者已经早在2008年8月25日就发出支持silverlight的Json.Net3.0版了。这里引用该作者的Blog,也为了方便我以后跟进:
Json.NET
The Json.NET library makes working with JavaScript and JsON formatted data in .NET simple. Quickly read and write JsON using the JsonReader and JsonWriter or serialize your .NET objects with a single method call using the JsonSerializer.
Json.NET CodePlex Project
Json.NET Download
Features
liNQ to JsON lightning fast JsonReader and JsonWriter The JsonSerializer for quickly converting your .NET objects to JsON and back again Json.NET can optionally produce well formatted,indented JsON for deBUGging or display Attributes like JsonIgnore and JsonProperty can be added to a class to customize how a class is serialized Ability to convert JsON to and from XML Supports multiple platforms: .NET,Silverlight and the Compact FrameworkExample
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 = JsonConvert.SerializeObject(product);
//{ // "name": "Apple", // "Expiry": new Date(1230422400000), // "Price": 3.99, // "Sizes": [ // "Small", // "Medium", // "Large" // ] //} Product deserializedProduct = JsonConvert.DeserializeObject<Product>(Json);
documentation
Json.NET - Quick Starts & API Documentation
History
Json.NET grew out of projects I was working on in late 2005 involving JavaScript,AJAX and .NET. At the time there were no librarIEs for working with JavaScript in .NET so I began to grow my own.
Starting out as a couple of static methods for escaPing JavaScript strings,Json.NET evolved as features were added. To add support for reading JsON a major refactor was required and Json.NET will split into the three major classes it still uses today,JsonReader,JsonWriter and JsonSerializer.
Json.NET was first released in June 2006. Since then Json.NET has been downloaded thousands of times by developers and is used in a number of major projects open source projects such as MonoRail,Castle Project's MVC web framework,and Mono,an open source implementation of the .NET framework.
Donate
Json.NET is a free open source project that is developed in personal time.
You can show your appreciation for Json.NET and support future development by donating.
总结以上是内存溢出为你收集整理的支持Silverlight +Json 的Json.Net全部内容,希望文章能够帮你解决支持Silverlight +Json 的Json.Net所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)