I am learning about JSON and I want to parse json array and get only one value using VB.Net. I found this QUESTION with answers but I didn't seem to get what I was looking for. According the the questioner, he has this
"links":[
{
"rel":"next",
"href":"www.google.com"
}
]
and we can use this to parse json array
links(1).Item("rel")
or this
links(1)("rel")
What if I only have this?
[{
"rel":"next",
"href":"www.google.com"
}]
How should I code it without the word links? I understand that links is the table name, isn't it? I tried so many possibilities which give me more errors. I'd appreciate much if anyone can help me out.
P.S. This not a duplicate to this because I am not going to add the information to a DataGridView. What I want here is to parse a field. Get only one result and not the entire list.
You need to do use :
Imports Newtonsoft.Json
JsonConvert.DeserializeObject(Of <Your Class object>)(<JSON String>)
go through with this link Deserialize Json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With