1

Blockchain.info API を使用しています。JSON レスポンスをデシリアライズしたい。応答の例:

{
    "addresses": [
        {
            "balance": 1400938800,
            "address": "1Q1AtvCyKhtveGm3187mgNRh5YcukUWjQC",
            "label": "SMS Deposits",
            "total_received": 5954572400
        },
        {
            "balance": 79434360,
            "address": "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq",
            "label": "My Wallet",
            "total_received": 453300048335
        },
        {
            "balance": 0,
            "address": "17p49XUC2fw4Fn53WjZqYAm4APKqhNPEkY",
            "total_received": 0
        }
    ]
}

問題は、これに合うクラスをどう作るかです。私はこれを試しましたが、うまくいきません:

Public Function LoadJson(ByVal json As String)
    Dim items As List(Of addresses) = JsonConvert.DeserializeObject(Of List(Of addresses))(json)
    Return items
End Function
Public Class addresses
    Public addresses As address()
End Class
Public Class address
    Public balance
    Public address
    Public label
    Public total_received
End Class

ありがとう!

4

1 に答える 1