DeserializeObject从JSON到动态类型

时间:2015-03-07 16:34:48

标签: json vb.net serialization deserialization json-deserialization

在VB.NET中,是否可以将JSON字符串反序列化为动态/未知数据类型,然后从对象中读取值?

    Dim js As New System.Web.Script.Serialization.JavaScriptSerializer()
    Dim o As Object = js.DeserializeObject(json)

    Dim s As String = String.Empty

    For Each i As PropertyInfo In o.GetType().GetProperties()
        s = String.Concat(s, i.Name) & "<br>"
    Next

    Response.Write(s)

它在对象中列出了一堆东西,但我似乎无法获得这些字段/属性的值。

0 个答案:

没有答案