0

http投稿から次のjson文字列があります:

Dim json As String = "{" + """contacts"":" + "[{" + """name"":""jocelyne" + """," + """mo"":""jocelyne" + """}" + ",{" + """name"":""eliane" + """," + """mo"":""12345678" + """}" + "]}"

このjson配列をデシリアライズするにはどうすればよいですか? 辞書を使用してみましたが、うまくいきませんでした。json 配列の長さが非常に大きい可能性があることに注意してください。

 Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer()
 Dim dict As Dictionary(Of String, String) = jss.Deserialize(Of Dictionary(Of String, String))(json)
 For Each item As KeyValuePair(Of String, String) In dict
        Response.Write(item.Key & " - " & item.Value & "<br>")
    Next
4

3 に答える 3