码迷,mamicode.com
首页 > Windows程序 > 详细

C#获取json字符串指定的值

时间:2016-11-29 14:09:07      阅读:267      评论:0      收藏:0      [点我收藏+]

标签:serialize   parse   ons   json.js   var   元素   serial   time   div   

Newtonsoft.Json在json和对象之间转化是一个非常强大的工具。

对象转化json字符串

Newtonsoft.Json.JsonConvert.SerializeObject()

json字符串转化为指定对象

 Newtonsoft.Json.JsonConvert.DeserializeObject<>()

json字符串直接获取指定元素值(类似XML)

var jObject  JObject.Parse(jsonstring);
var time= jObject["time"].ToString();//获取time{"time":"2016-06-06 11:11:11"}

 

C#获取json字符串指定的值

标签:serialize   parse   ons   json.js   var   元素   serial   time   div   

原文地址:http://www.cnblogs.com/loyung/p/6113011.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!