创建JSON与.NET [英] Create JSON with .net
问题描述
首先,让我先过,我不是一个.NET开发人员。为什么我问这个问题的原因是,我们推出了我们的REST API和我们的第一个集成合作伙伴之一,是一个.NET店。
First off, let me start off that I am not a .net developer. The reason why I am asking this question is that we rolled out our REST-API and one of our first integration partners is a .net shop.
因此,基本上,我们认为.NET将提供某种形式的包装,以创建JSON,但有问题的开发人员创建的的字符串的手。我研究过这个话题一点,我真的无法找到任何东西,但我相信.NET提供的东西。 :)
So basically we assumed that .net would provide some sort of wrapper to create JSON, but the developer in question created the string by hand. I've researched this topic a bit and I couldn't really find anything, though I believe .net provides something. :)
'current code
Dim data As String
data = "[hello, world]"
在PHP中我会做以下(假设转/ JSON可用):
In PHP I would do the following (assuming ext/json is available ;):
<?php
$json = array('hello', 'world');
$json = json_encode($json);
我也有兴趣在你用什么去$ C C的JSON $到一个数组/对象结构。
I am also interested in what you use to decode the json into an array/object structure.
帮助非常AP preciated。
Help is very appreciated.
推荐答案
有一对夫妇的第一方和第三方选件。 里克施特拉尔有一个很好的概述。 JSON.net 是最流行的第三方选择。
There are a couple first-party and third-party options. Rick Strahl has a good overview. JSON.net is the most popular third-party option.
这篇关于创建JSON与.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!