Public Property Name() As String
Get
Return m_Name
End Get
Set(ByVal NewName As String)
m_Name = NewName
End Set
End Property
Public Function Clone() As CResume
Dim BF As New BinaryBinaryFormatter()
Dim MS As New MemoryStream()
BFSerialize(MS Me)
MSPosition =
Return (CType(BFDeserialize(MS) CResume))
End Function
End Class
在Form里面可以这样调用
Dim Resume As New CResume()
Dim Resume As New CResume()
ResumeName = AAA
ResumeAddress = office:smarttags />ShanghaiChina
Resume = ResumeClone()
ResumeName = BBB
ResumeAddress = BeijingChina
DebugWriteLine(ResumeName) 依然是AAA
DebugWriteLine(ResumeAddress)
总结主要调用了VBNET的流和序列化技术使得对象的克隆免去了繁琐的读写操作也简化了代码
[] []