I know there are a few posts about Newtonsoft so hopefully this isn\'t exactly a repeat...I\'m trying to convert JSON data returned by Kazaa\'s API into a nice object of som
Finally Get State Name From JSON
Thankyou!
Imports System
Imports System.Text
Imports System.IO
Imports System.Net
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports System.collections.generic
Public Module Module1
Public Sub Main()
Dim url As String = "http://maps.google.com/maps/api/geocode/json&address=attur+salem&sensor=false"
Dim request As WebRequest = WebRequest.Create(url)
dim response As WebResponse = DirectCast(request.GetResponse(), HttpWebResponse)
dim reader As New StreamReader(response.GetResponseStream(), Encoding.UTF8)
Dim dataString As String = reader.ReadToEnd()
Dim getResponse As JObject = JObject.Parse(dataString)
Dim dictObj As Dictionary(Of String, Object) = getResponse.ToObject(Of Dictionary(Of String, Object))()
'Get State Name
Console.WriteLine(CStr(dictObj("results")(0)("address_components")(2)("long_name")))
End Sub
End Module