我有 jquery 循环遍历一个 html 表并将其放入一个对象中,然后JSON.stringify
用于将该 javascript 对象转换为 json ,请参见下面的 json
{
"0":{"name":"fdgd","surname":"ssdt"},
"1":{"name":"fdsf","surname":"vn"},
"2":{"name":"dfsb","surname":"mry"},
"3":{"name":"hsdsdfry","surname":"smh"}
}
我的问题是 JSON.net 和我正在尝试匹配的类以将 json 转换为我的tableT
对象
在Jsonconvert
我得到空对象之后,你能告诉我我的课程有什么问题吗?我正在使用 vb.net 和 .net 2。所以我想我的问题是如何将我的 tableT 类与我的 json 字符串匹配?感谢您的帮助。
Dim tableOBJ As tableT = JsonConvert.DeserializeObject(Of tableT)(myJSON)
Public Class tableT
Private _allRows As List(Of Rows)
Property AllRows As List(Of Rows)
Get
Return _allRows
End Get
Set(ByVal value As List(Of Rows))
_allRows = value
End Set
End Property
End Class
Public Class Rows
Private _name As String
Private _surname As String
Property name As String
Get
Return _name
End Get
Set(ByVal value As String)
_name = value
End Set
End Property
Property surname As String
Get
Return _surname
End Get
Set(ByVal value As String)
_surname = value
End Set
End Property
End Class