item.Values
<pre lang="vb"><pre> Protected Sub getThermoss() Dim request As WebRequest = WebRequest.Create("http://192.168.1.42/JSON?request=getstatus&ref=25") ' If required by the server, set the credentials. request.Credentials = CredentialCache.DefaultCredentials ' Get the response. Dim response As WebResponse = request.GetResponse() ' Display the status. 'Console.WriteLine(CType(response, HttpWebResponse).StatusDescription) ' Get the stream containing content returned by the server. Dim dataStream As Stream = response.GetResponseStream() ' Open the stream using a StreamReader for easy access. Dim reader As New StreamReader(dataStream) ' Read the content. Dim responseFromServer As String = reader.ReadToEnd() ' Display the content. Dim json As String = responseFromServer Dim ser As JObject = JObject.Parse(json) Dim data As List(Of JToken) = ser.Children().ToList Dim output As String = "" For Each item As JProperty In data item.CreateReader() Select Case item.Name Case "Devices" output += "Comments:" + vbCrLf For Each comment As JObject In item.Values Dim u As String = comment("value") Dim d As String = comment("date") Dim c As String = comment("comment") output = u Next End Select Next Thermos.Text = output ' Clean up the streams and the response. reader.Close() response.Close() End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)