原理已说明,最后贴出已封装好的实现代码: using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Linq; namespace Zuowj.EasyUtils { /// /// JObject扩展类 /// author:zuowenjun /// 2019-6-15 /// public static class JObjectExtensions { /// /// 根据Jpath查找JSON指定的属性节点值 /// /// /// /// public static IEnumerable FindJsonNodeValues(this JObject jObj, string fieldPath) { var tks = jObj.SelectTokens(fieldPath, true); List nodeValues = new List; foreach (var tk in tks) { if (tk is JProperty) { var jProp = tk as JProperty; nodeValues.Add(jProp.Value); } else { nodeValues.Add(tk); } } return nodeValues; } /// /// 根据Jpath查找JSON指定的属性节点并赋值 /// /// /// /// public static void SetJsonNodeValue(this JObject jObj, string fieldPath, JToken value) { var tks = jObj.SelectTokens(fieldPath, true); JArray targetJArray = null; List arrIndexs = new List; foreach (var tk in tks) { JProperty jProp = null; if (tk is JProperty) { jProp = tk as JProperty; } else if (tk.Parent is JProperty) { jProp =