在asp.net中反序列化json数组

问题描述 投票:0回答:3

我在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
asp.net arrays json vb.net http-post
3个回答
0
投票

尝试一下


0
投票

尝试使用JSON.Net


0
投票

尝试一下,这是C#代码

© www.soinside.com 2019 - 2024. All rights reserved.