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

问题描述

我一直在寻找到几个JSON解析器.NET( LitJSON ,的和 JSON.NET ) ,并想知道如果任何人有任何与他们的经验,并能揭示的差异和优劣为他们每个人的一些情况。

解决方案

由于这个线程似乎吸引很少关注,这是我落得这样做:liJson是出于图片pretty的快,因为它似乎并没有得到积极的维护。 (短短数天前公布的两个版本),剩下的两个之间我选择了Json.NET因为它似乎

  1. 有一个稍微简单的序列化API。
  2. 更受欢迎。

经过几次实验,我不得不说,我对结果感到高兴 - 我设法实现我想要的多,而且编写自定义的转换器是一件轻而易举的事,以2分4行code

I've been looking into several JSON parsers for .NET (LitJSON, JsonExSerializer and JSON.NET), and was wondering if anyone has any experience with them and can shed some light on the differences and the pros and cons for each of them.

解决方案

Since this thread seems to attract very little attention, here's what I ended up doing:liJson was out of the picture pretty fast as it does not seem to be actively maintained. Between the remaining two (both released versions just a few days ago) I chose Json.NET as it seems to

  1. have a slightly simpler serialization API.
  2. be more popular.

After a few experiments I have to say I'm happy with the results - I managed to achieve all I wanted and more, and writing custom converters was a breeze, taking 2 minutes and 4 lines of code.

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

08-05 18:37