I'm working on a product in VB.NET and using the JSON class from NewtonSoft to process JSON. I don't know how to use it though and I can't seem to figure ou the doc. Basically, given a JSON string, I want to pull out the amount value. Here's what I have:
Dim serverResponse as String
Dim urlToFetch as String
Dim jsonObject as Newton.JSON.JSONConvert
Dim wc as new System.Net.WebClient
Dim amountHeld as String
urlToFetch = "someurl"
serverResponse = wc.DownloadString(urlToFetch)
jsonObject = Newtonsoft.Json.JsonConvert.DeserializeObject(serverResponse)
Now, at this point, I was hoping to be able to do a
amountHeld = jsonObject.Name["amount"]
to get the value of amount but I can't. I'm obviously doing it wrong. What is the proper way to do this?
Thanks! Anthony
serverResponse? Just put a breakpoint atamountHeldline of code and inspect the value ofjsonObject.