标签:
Newtonsoft.Json.dll
public class ErrorInfo {
public error_response error_response { get; set; }
}
public class error_response
{
public string code { get; set; }
public string zh_desc { get; set; }
public string en_desc { get; set; }
}
//嵌套性数据 // {"error_response": {"code":"001","zh_desc":"信息无效"}} //解析方法一: 解析成一个对象实体 ErrorInfo obj = (ErrorInfo)JsonConvert.DeserializeObject(jsonText, typeof(ErrorInfo)); //解析方法二: 解析对象 JObject jo = (JObject)JsonConvert.DeserializeObject(jsonText); string code = jo["error_response"]["code"].ToString(); string zone = jo["error_response"]["zh_desc"].ToString();
标签:
原文地址:http://www.cnblogs.com/su-king/p/5478394.html