我真的不明白我做錯了,當我嘗試反序列化我得到的JSON的東西。SteamAPI JSON.net錯誤在VB .net
你可以從http://api.steampowered.com/ISteamApps/GetAppList/v2?format=json
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim SteamGameInfoObject As Object = JsonConvert.DeserializeObject(Of Object)(New System.Net.WebClient().DownloadString("http://api.steampowered.com/ISteamApps/GetAppList/v2?format=json"))
End Sub
Public Class SteamRootObject
Public Class SteamAPIJSONResult
Public Property applist As List(Of applistlist)
End Class
Public Class applistlist
Public Property apps As List(Of appslist)
End Class
Public Class appslist
Public Property appid As Integer()
Public Property name As String()
End Class
End Class
End Class
我不知道如何「要解決這個錯誤要麼改變JSON以JSON數組」
你沒有告訴我們錯誤信息的第一部分,我們不能告訴你如何解決這個問題,而不會看到你使用的代碼。這聽起來像你不是反序列化到一個數組類型 – Plutonix
我要編輯它的完整源代碼。 – McLucario
@Plutonix好了。 – McLucario