I have the following code, it connects to PHP server and retrieve data successfully, i\'m not very good with VB, how can i read the JSON response text and extract it\'s elem
@razzak is absolutely right to use the Json.Net NuGet package. Another option that would cut this down dramatically, is to use the built in DeserializeObject function. As long as you have a well define model, then you can deserialize the Json right into an instance of the object using something like this:
dim myObject as MyDefinedObject = JsonConvert.DeserializeObject(responseFromServer)
or this in C#
MyDefinedObject m = JsonConvert.DeserializeObject(responseFromServer);
Also, if you don't want to loop, you could also select tokens using something like this:
Dim d = ser.SelectToken("$..resources[?(@)].travelDistance")
This code above was used to locate the travelDistance between two points from the Bing API. If you have ever dealt with the Bing or Google Map REST APIs, then you know the JSon is generally too large to loop through the data when you are looking for very specific values.
I hope this is helpful for anyone looking to do something like this. The JSon.Net website has a blog page that goes through some additional examples.
http://james.newtonking.com/json
~Cheers