JSON数据进入Winform文本框

时间:2019-06-16 13:09:16

标签: vb.net

我正在尝试以JSON格式提取OpenLib的内容,并使用相应的数据填充Winform文本框

通过传递本书的ISBN,我已经能够使用webclient从OL下载数据。现在我已经下载了整个JSON数据

Dim urlstring As String = "https://openlibrary.org/api/books?bibkeys=ISBN:" & Trim(txtisbn.Text) & "&format=json&jscmd=data"


Dim sourceString As String = New System.Net.WebClient().DownloadString(urlstring)



Dim urlstring As String = "https://openlibrary.org/api/books?bibkeys=ISBN:" & Trim(txtisbn.Text) & "&format=json&jscmd=data"


Dim sourceString As String = New System.Net.WebClient().DownloadString(urlstring)

txtdesc.Text = sourceString

我能够在复杂的JSON响应中得到结果:

{"ISBN:9780448411064": {"publishers": [{"name": "Grosset & Dunlap"}], "weight": "20 pounds", "title": "War Of The Worlds", "url": "/books/OL10266022M/War_Of_The_Worlds", "identifiers": {"isbn_13": ["9780448411064"], "openlibrary": ["OL10266022M"], "isbn_10": ["0448411067"], "librarything": ["11494"], "goodreads": ["4335951"]}, "cover": {"small": "https://covers.openlibrary.org/b/id/7885473-S.jpg", "large": "https://covers.openlibrary.org/b/id/7885473-L.jpg", "medium": "https://covers.openlibrary.org/b/id/7885473-M.jpg"}, "subject_places": [{"url": "/subjects/place:mars_(planet)", "name": "Mars (Planet)"}], "subjects": [{"url": "/subjects/in_library", "name": "In library"}, {"url": "/subjects/science_fiction_&_fantasy", "name": "Science Fiction & Fantasy"}, {"url": "/subjects/accessible_book", "name": "Accessible book"}, {"url": "/subjects/fiction_in_english", "name": "Fiction in English"}, {"url": "/subjects/fiction", "name": "Fiction"}, {"url": "/subjects/overdrive", "name": "OverDrive"}, {"url": "/subjects/diseases", "name": "Diseases"}, {"url": "/subjects/martians", "name": "Martians"}, {"url": "/subjects/invasions", "name": "Invasions"}, {"url": "/subjects/classic_literature", "name": "Classic Literature"}, {"url": "/subjects/open_library_staff_picks", "name": "Open Library Staff Picks"}, {"url": "/subjects/space_warfare", "name": "Space warfare"}, {"url": "/subjects/open_syllabus_project", "name": "open_syllabus_project"}, {"url": "/subjects/english_science_fiction", "name": "English Science fiction"}, {"url": "/subjects/imaginary_wars_and_battles_in_literature", "name": "Imaginary wars and battles in literature"}, {"url": "/subjects/mars_(planet)", "name": "Mars (Planet)"}, {"url": "/subjects/science_fiction", "name": "Science fiction"}, {"url": "/subjects/juvenile_fiction", "name": "Juvenile fiction"}, {"url": "/subjects/space_vehicles", "name": "Space vehicles"}, {"url": "/subjects/imaginary_wars_and_battles", "name": "Imaginary wars and battles"}, {"url": "/subjects/protected_daisy", "name": "Protected DAISY"}, {"url": "/subjects/earth", "name": "Earth"}], "subject_people": [{"url": "/subjects/person:h._g._wells_(1866-1946)", "name": "H. G. Wells (1866-1946)"}], "key": "/books/OL10266022M", "authors": [{"url": "/authors/OL13066A/H._G._Wells", "name": "H. G. Wells"}], "publish_date": "March 1, 1978", "ebooks": [{"checkedout": false, "formats": {}, "preview_url": "https://archive.org/details/warofworlds00hgwe", "borrow_url": "/books/OL10266022M/War_Of_The_Worlds/borrow", "availability": "borrow"}]}}

现在我不知道该怎么做才能获取这些数据 我在VS 2019上使用Winform / VB

0 个答案:

没有答案