dim json as string = "上面的json....."Dim ja As JArray = JArray.Parse(json)
dim dict as new dictionary(of string,integer)
Dim jo As JObject
For i As Integer = 0 To ja.Count - 1
jo =ja(i)
Dim ja2 As JArray = jo("因数")
For j As Integer = 0 To ja2.Count - 1
if dict.containskey(ja2(j).tostring) then
dict(ja2(j).tostring) += cint(jo("数量"))
else
dict.add(ja2(j).tostring,cint(jo("数量")))
end if
Next
Next
For Each k As string In dict.Keys '显示所有键及其对应的值
Output.Show(K & ":" & dict(k))
Next