Un json così non lo avevo ancora disassemblato. Perciò questo è un tentativo (funzionate) da rivedere
codice:
Option Strict On
Imports l = libreria.ModuloWeb
Imports Newtonsoft.Json
Partial Class prove_a
Inherits System.Web.UI.Page
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim wc As System.Net.WebClient = Nothing
Try
wc = New System.Net.WebClient()
Dim url As String = "https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-json/dpc-covid19-ita-andamento-nazionale.json"
Dim s As String = "{Propertys:" & wc.DownloadString(url) & "}"
Dim r As Rootobject = If(Not String.IsNullOrWhiteSpace(s), JsonConvert.DeserializeObject(Of Rootobject)(s), New Rootobject())
'stampo data e deceduti
For Each p In r.Propertys
PrintLn(Me.PlaceHolder1, p.deceduti, p.data.ToString)
Next
Catch ex As Exception
Me.Label1.Text = l.exMessageErrorForLabel(ex)
End Try
End Sub
Public Class Rootobject
Public Property Propertys As List(Of Class1)
End Class
Public Class Class1
Public Property data As Date
Public Property stato As String
Public Property ricoverati_con_sintomi As Integer
Public Property terapia_intensiva As Integer
Public Property totale_ospedalizzati As Integer
Public Property isolamento_domiciliare As Integer
Public Property totale_attualmente_positivi As Integer
Public Property nuovi_attualmente_positivi As Integer
Public Property dimessi_guariti As Integer
Public Property deceduti As Integer
Public Property totale_casi As Integer
Public Property tamponi As Integer
Public Property note_it As String
Public Property note_en As String
End Class
End Class