[VB]解析JSON
線上解析JSON 將JSON解析,並存到StringBuilder Public Sub Get_chart_data() Dim chart_data As New StringBuilder() Dim objWebClient As New System.Net.WebClient Dim Url As String = "http://localhost/CoalTc/highchart_linechart.json" Dim JsonStr As String = "" JsonStr = Encoding.UTF8.GetString(objWebClient.DownloadData(New Uri(Url.Trim()))) Dim Obj As Newtonsoft.Json.Linq.JObject = Newtonsoft.Json.JsonConvert.DeserializeObject(JsonStr) '取得物件明細的方法 依據階層 Obj.item("階層1")("階層2") 以此類推 Dim j As Integer 'For j = 0 To i For Each aa In Obj For Each bb In aa.Value ...