关于vb的xml串行化问题
我的想法如下,写了一个大的public类,
Public Class graphics
Public Class line
Public start_x As Integer
Public start_y As Integer
Public end_x As Integer
Public end_y As Integer
End Class
Public Class circle
Public radius As Integer
Public circlex As Integer
Public circley As Integer
End Class
Public Class rectangle
Public start_x As Integer
Public start_y As Integer
Public width As Integer
Public height As Integer
End Class
End Class
这样穿行化出来就是一个graphic的主属性。
接下来我分别声明了三个数组
Public oline(1023) As graphics.line
Public ocircle(1023) As graphics.circle
Public orectangle(1023) As graphics.rectangle
我的想法是我声明一个对象就在数组中添加一个元素
我想得到一个xml的形式如下
<graphics>
<line>
<line_1> .. </line_1>
...
<line_x> ..</line_x>
</line>
<circle>
<circle_1>..</circle_1>
...
<circle_x>..</circle_x>
</circle>
<rectangle>
<rectangle_1>..</rectangle_1>
..
</rectangle>
</graphics>
多谢高手指点