Add method to object:
Public Function Clone() As Home
Dim m As New MemoryStream()
Dim b As New BinaryFormatter()
b.Serialize(m, Me)
m.Position = 0
Return b.Deserialize(m)
End Function
Showing code
Dim obj As New MyObject()
Dim objNew As MyObject= obj .Clone
No comments:
Post a Comment