本文介绍了JSON.NET JsonConvert VS .NET JavaScriptSerializer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是更好的,当涉及到编码和JSON的.NET解码使用?我曾经尝试都和高达至此JsonConvert似乎是在做一个好工作。我已经使用JavaScriptSerializer过去成功但有在最近的过去与它存在一些问题。它是更好地使用JSON.NET比.NET类?

What is better to use when it comes to encoding and decoding of JSON in .NET? I have tried both and upto this point JsonConvert seems to be doing a good job. I have used JavaScriptSerializer in the past successfully but have had some problems in the recent past with it. Is it better to use JSON.NET than the .NET class?

什么是使用适当的库preferred编码/解码JSON的功能?我用SerializeObject / DeSerializeObject从JSON.NET和序列化/反序列化的.NET。

What are the preferred functions for encoding/decoding json using the appropriate library? I use SerializeObject/DeSerializeObject from JSON.NET and Serialize/DeSerialize from .NET.

感谢

推荐答案

我没有足够的代表处发表评论还因此不得不张贴此作为回答。我想正是那种你正在寻找比较。

I don't have enough rep to comment yet so had to post this as an answer. I think this is exactly the kind of comparison you are looking for.

这基本上说,JSON.Net是更好,因为它除其他事项外...

It basically says that JSON.Net is better because it among other things...

  • 更快
  • LINQ 以JSON支持
  • 转换 JSON和从 XML
  • Is faster
  • Has LINQ to JSON support
  • Can convert JSON to and from XML

在我看来,唯一积极的,(这是一个很小的正数),我可以看到内置的序列化是没有多余的对外依存度来管理。

In my opinion the only positive, (and it is a small positive), I can see for the built-in serializer is that there is no extra external dependency to manage.

这篇关于JSON.NET JsonConvert VS .NET JavaScriptSerializer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 15:01