开发者

Create JSOnObject using JSon.net manually

开发者 https://www.devze.com 2023-02-05 03:26 出处:网络
I\'m using Facebook C# SDK. In general it works fine but for a unit test I have开发者_开发问答 to create a JSONObject on my own. First I tried with \"JSONObject.Add\" but I did not find out how to wri

I'm using Facebook C# SDK. In general it works fine but for a unit test I have开发者_开发问答 to create a JSONObject on my own. First I tried with "JSONObject.Add" but I did not find out how to write subnodes then. So I started working with XML and using "SerializeXMLNode". This works fine, so now I have the JSON-String. But how could I create a JSONObject from this string now??


using System.Net;

//

string jsonString = [YOUR JSON-STRING];

var json = new WebClient().DownloadString(jsonUrl);

I hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消