This project has moved and is read-only. For the latest updates, please go here.

Read string json with Json.NET

Oct 13, 2008 at 4:36 PM
I want to implement a search in Google for my site using the data of codified return in the JSON strings.

In my code, I read the results within the following code (url is an example) : 

Dim client As WebClient = New WebClient
Dim urlFormat As String = ""
If String.IsNullOrEmpty(urlFormat) Then
urlFormat = ""
End If
Dim url As Uri = New Uri(urlFormat)
Dim Search As String = client.DownloadString(url)

I want to decode it, but I obtained an error: 
Dim reader As JsonTextReader = New JsonTextReader(New StringReader(Search))

I obtained the following error: 
JSON root object has multiple properties. The root object must have a single property in order to create a valid XML document.

How can I read the results beginning from the JSON string like this:
{"responseData": {
"results": [
"GsearchResultClass": "GwebSearch",
"unescapedUrl": "",
"url": "",
"visibleUrl": "",
"cacheUrl": "\",
"title": "\u003cb\u003eParis Hilton\u003c/b\u003e - Wikipedia, the free encyclopedia",
"titleNoFormatting": "Paris Hilton - Wikipedia, the free encyclopedia",
"content": "\[1\] In 2006, she released her debut album..."
"GsearchResultClass": "GwebSearch",
"unescapedUrl": "",
"url": "",
"visibleUrl": "",
"cacheUrl": "\",
"title": "\u003cb\u003eParis Hilton\u003c/b\u003e",
"titleNoFormatting": "Paris Hilton",
"content": "Self: Zoolander. Socialite \u003cb\u003eParis Hilton\u003c/b\u003e..."
"cursor": {
"pages": [
{ "start": "0", "label": 1 },
{ "start": "4", "label": 2 },
{ "start": "8", "label": 3 },
{ "start": "12","label": 4 }
"estimatedResultCount": "59600000",
"currentPageIndex": 0,
"moreResultsUrl": "\u003dutf8\u0026ie\u003dutf8..."
, "responseDetails": null, "responseStatus": 200}

I would like to read the data in this way: 


Is it possible to achieve?
Oct 27, 2008 at 9:05 AM
That error message does not match up with your examples. There is no way you could have gotten it.