fastJSON
fastJSON copied to clipboard
How does the JSON.Parse(json) function get the total number of records returned?
How to get the total number of records returned by using the JSON.Parse(json) function? I use JSON.Parse(json).count to return only the number 5, which actually has 364 records.
Please post your json string.
json.txt The total number of records is 364.
Dim sJson As String = IO.File.ReadAllText("..\..\json.txt") Try For i As Long = 0 To JSON.Parse(sJson).count TextBox2.Text += vbCrLf & JSON.Parse(sJson)("data")(i)("bond_nm").ToString 'textBox1.Text Next i Catch ex As Exception MsgBox(ex.Message) End Try
I got it this way.
Try :
( JSON.Parse(sJson) as Dictionary<string, object>) ["data"].Count // in c#
Thank you, mgholam! It turned out that my method was wrong.