System.Web.Script.Serialization.JavaScriptSerializer或System.Runtime.Serialization.Json.DataContractJ

编程入门 行业动态 更新时间:2024-10-22 23:46:25
本文介绍了System.Web.Script.Serialization.JavaScriptSerializer或System.Runtime.Serialization.Json.DataContractJsonSerializer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

什么是两者之间的区别是什么?为什么要使用一个比其他?

What's the difference between the two? Why would you use one over the other?

推荐答案

在这里找到:的 aaron-powell.spaces.live/blog/cns!91A824220E2BF369!150.entry

DataContractJsonSerializer 该DataContractJsonSerializer的主要目的是要与WCF使用,因为一个序列是WCF的一大焦点。此外,它也更好地处理复杂的类具有可序列化只是某些属性。 这个类是更强类型,有大约类型(S)更多的知识它的操控性和更好的错误处理不好形成JSON。

DataContractJsonSerializer The primary purpose of the DataContractJsonSerializer is to be used with WCF, since one serialization is a big focus of WCF. Also, it is also better equipped to handle complex classes which have only certain properties available for serialization. This class is more strongly typed, has more knowledge about the type(s) it's handling and better error handling for badly-formed JSON.

JavaScriptSerializer 此类在另一方面是更好的装备进行快速的序列化,这是一个更加牛仔的方法。有较少的错误检查和过什么样的属性这是序列化的控制较少。

JavaScriptSerializer This class on the other hand is much better equipped for quick serialization, it's a more cowboy approach. There's less error checking and less control over what properties which are serialized.

更新

由于上面的链接是死的,这里是另一个链接: kbblogs / A / 1454030 。

As the above link is dead, here is another link: kbblogs/a/1454030.

更多推荐

System.Web.Script.Serialization.JavaScriptSerializer或System.Runtime.Serializatio

本文发布于:2023-11-10 02:20:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1574075.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Script   Serialization   System   Web   Json

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!