我有一个来自提供程序的简化JSON字符串,自从我使用Visual Studio和vb.Net以来已经很久了,所以我非常生疏!
{
"Venue": {
"ID": 3145,
"Name": "Big Venue, Clapton",
"NameWithTown": "Big Venue, Clapton, London",
"NameWithDestination": "Big Venue, Clapton, London",
"ListingType": "A",
"Address": {
"Address1": "Clapton Raod",
"Address2": "",
"Town": "Clapton",
"County": "Greater London",
"Postcode": "PO1 1ST",
"Country": "United Kingdom",
"Region": "Europe"
},
"ResponseStatus": {
"ErrorCode": "200",
"Message": "OK"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我想使用JSON.Net将其转换为我可以使用的东西,我已经阅读了示例等,JSON.net看起来像答案,但我没有在哪里.
我的.Net代码(Me.TextBox1.Text包含上面显示的JSON)
Imports Newtonsoft.Json
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim obj As JSON_result
obj = JsonConvert.DeserializeObject(Of JSON_result)(Me.TextBox1.Text)
MsgBox(obj.ID)
End …Run Code Online (Sandbox Code Playgroud)