여러 개의 목록이 있다는 사실 때문에이 테이블을 비 직렬화하는 데 문제가 있습니다. 반복 할 때 목록에 내 목록이 필요하다는 것을 이해합니다. 또한 반복 할 때 내 tds에도 목록이 필요합니다. 문제는 tds의 값을 읽으 려 할 때 나온다. 목록 형식으로되어 있기 때문이다.여러 목록을 가진 테이블을 deserialize하는 방법
<table>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</table>
그리고 내 수업 : 여기
내 XML의Public Class table
Private newtr As List(Of tr)
<XmlElement()> _
Public Property tr() As List(Of tr)
Get
Return newtr
End Get
Set(ByVal value As List(Of tr))
newtr = value
End Set
End Property
End Class
Public Class tr
Private newtd As List(Of td)
<XmlElement()> _
Public Property td() As List(Of td)
Get
Return newtd
End Get
Set(ByVal value As List(Of td))
newtd = value
End Set
End Property
End Class
Public Class td
Private newvalue As String
<XmlElement()> _
Public Property td() As String
Get
Return newvalue
End Get
Set(ByVal value As String)
newvalue = value
End Set
End Property
End Class
그리고 내 코드 : 나는 각각의 값을 얻을 수있는 방법에 대한
Public Sub test2()
Dim rr As New table()
Dim xx As New XmlSerializer(rr.GetType)
Dim objStreamReader2 As New StreamReader("table.xml")
Dim rr2 As New table()
rr2 = xx.Deserialize(objStreamReader2)
For Each ii As tr In rr2.tr
MsgBox(ii.td)
Next
End Sub
그래서 어떤 아이디어 TDS 안에? 감사!
다시 스티븐이 아닌 경우. :) – user1676874
아! 그것은 당신입니다 :) 나는 당신의 숫자로 당신을 인식하지 못했습니다. 내 사진을 업데이트해야합니다. 약간 불안해합니다. –
나는 그것을 고쳐야하고, 프로그래머처럼 보일 뿐이다. :) – user1676874