C#获取Json文件的树节点
程序员文章站
2022-06-12 17:05:44
...
using System;
using System.Web;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft;
using System.IO;
using System.Collections.Generic;
using System.Data;
using Newtonsoft.Json.Converters;
string json = @"{
'CPU': 'Intel',
'PSU': '500W',
'Drives': [
'DVD read/writer'
/*(broken)*/,
'500 gigabyte hard drive',
'200 gigabype hard drive'
]
}";
var jObject = JObject.Parse(json);
// context.Response.Write(jObject["CPU"]);
context.Response.Write(jObject.SelectToken("CPU"));
https://q.cnblogs.com/q/53249/
上一篇: C#实现获取枚举的描述
下一篇: 知识图谱综述学习笔记