Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 反序列化JSON VB.NET_Mysql_Json_Vb.net_Web Services_Serialization - Fatal编程技术网

Mysql 反序列化JSON VB.NET

Mysql 反序列化JSON VB.NET,mysql,json,vb.net,web-services,serialization,Mysql,Json,Vb.net,Web Services,Serialization,我在使用VB.NET反序列化JSON时遇到了一个大问题,下面是JSON示例: [{"id":"1","numerTel":"48123123123","pozostalo":"50","reffer":"","email":""},{"id":"2","numerTel":"48123123123","pozostalo":"10","reffer":"","email":""}] 这是由mysql select*查询生成的json,我的vb应用程序正在连接到php脚本,php脚本返回json

我在使用VB.NET反序列化JSON时遇到了一个大问题,下面是JSON示例:

[{"id":"1","numerTel":"48123123123","pozostalo":"50","reffer":"","email":""},{"id":"2","numerTel":"48123123123","pozostalo":"10","reffer":"","email":""}]
这是由mysql select*查询生成的json,我的vb应用程序正在连接到php脚本,php脚本返回json数组和数据。如何反序列化并使用每一行,我想解析每一行。 这是我在vb中的实际代码:

Dim jsonResponse As String = "[{""id"":""1"",""numerTel"":""48123123123"",""pozostalo"":""50"",""reffer"":"""",""email"":""""},{""id"":""2"",""numerTel"":""48123123123"",""pozostalo"":""10"",""reffer"":"""",""email"":""""}]"
        Dim aba As MyC = JsonHelper.JsonDeserialize(Of MyC)(jsonResponse)
和类别:

 Public Class MyC
        Public Property id() As String
            Get
                Return m_id
            End Get
            Set
                m_id = Value
            End Set
        End Property
        Private m_id As String
        Public Property numerTel() As String
            Get
                Return m_numerTel
            End Get
            Set
                m_numerTel = Value
            End Set
        End Property
        Private m_numerTel As String
        Public Property pozostalo() As String
            Get
                Return m_pozostalo
            End Get
            Set
                m_pozostalo = Value
            End Set
        End Property
        Private m_pozostalo As String
        Public Property reffer() As String
            Get
                Return m_reffer
            End Get
            Set
                m_reffer = Value
            End Set
        End Property
        Private m_reffer As String
        Public Property email() As String
            Get
                Return m_email
            End Get
            Set
                m_email = Value
            End Set
        End Property
        Private m_email As String

    End Class

谢谢你的帮助

JSON不代表
MyC
的实例。它表示(MyC的)列表的一个实例(或者任何可枚举的集合)


“大问题”是什么?请参阅:。一般来说,如果你反序列化,你不需要解析,你忘记了描述问题的部分。此代码以何种方式未按预期工作?例如:get from id:0 value reffer:
Dim aba As List(Of MyC) = JsonHelper.JsonDeserialize(Of List(Of MyC))(jsonResponse)