JSON格式转换方案

1、B/S模式下,调用json.js 

2、C/S模式下,引用.NET自带的命名空间 

using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Runtime.Serialization.Json;
using System.IO; 

3、C/S模式下,引用Newtonsoft.Json.dll 

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq; 

JObject o = JObject.Parse(jsonstring);
obj_str = o["Location"][0]["BillDesc"][0]["Bill"].ToString();

 

 

posted @ 2011-01-20 16:59  RF.W  阅读(414)  评论(0编辑  收藏  举报