C#遍历JObject

JObject pcount = new JObject();
int numTotal = 0;
IEnumerable<JProperty> properties = pcount.Properties();
foreach (JProperty item in properties)
{
     
	numTotal += int.Parse(item.Value.ToString());
	// item.Name 为 键
	// item.Value 为 值
}

你可能感兴趣的:(C#)