ITPub博客

首页 > > > .Net 2.0里怎么解析Json啊?

.Net 2.0里怎么解析Json啊?

作者:yesye 时间:2019-10-28 17:11:22 0 删除 编辑

{name:"aa",sex:"男"}

对方发来的这种格式的字符串,怎么解析啊?

 

 

JsonTextReader reader = new JsonTextReader(new StreamReader({name:"aa",sex:"男"}));

while (reader.Read())

{

reader.Value.ToString();

}

 

这种方法读的value连name 和sex字段都一起读出来了,怎么根据指定字段读对应的值啊?

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2041/viewspace-3137545/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-09-06

  • 博文量
    139
  • 访问量
    9689