问题
I have the following json output:
{
"id":"354asda-asd435544-35438738fd",
"oid":"354asda-asd435544-35438738fd-asdasd1212",
"mids":[
476252
],
"name":"This is my name",
"language":"en",
"released":"2020-01-24",
"url":"https://myownurl",
"url2":"https://myownurl2",
"image":true,
"image_url":{
"small":"https://myownurl/img_sm.jpg",
"large":"https://myownurl/img_lg.jpg",
"png":"https://myownurl/img_sm.png",
},
...
}
I'm trying to access this information, but getting some trouble with it, with the image_url property.
Dim selected As String = ListBox1.SelectedItem()
Dim splited() As String = selected.Split(" - ")
Dim card As String = ListBox2.SelectedItem()
Dim cardsplit() As String = card.Split(" - ")
Dim uriString As String = "https://myownapi/" & splited(0) & "/" & cardsplit(0)
Dim Request As HttpWebRequest = WebRequest.Create(New Uri(uriString))
Dim JSON_Response As String = New StreamReader(Request.GetResponse().GetResponseStream()).ReadToEnd()
Dim JSON_Obj1 As Object = New JavaScriptSerializer().DeserializeObject(JSON_Response)
TextBox2.Text = JSON_Response.ToString
Dim Test1 As String = JSON_Obj1("image_url")
TextBox1.Text = Test1("large")
How can I properly access all this information, including information inside those brackets [ ] and { }? Thanks.
来源:https://stackoverflow.com/questions/60800422/vb-net-access-json-information