Imports System.Runtime.Serialization.Formatters.Binary
Imports System.Runtime.Serialization
Function ObjectCopy(ByVal obj As Object) As Object
Dim objMemStream As New MemoryStream(5000)
Dim objBinaryFormatter As New BinaryFormatter(Nothing, New StreamingContext(StreamingContextStates.Clone))
objBinaryFormatter.Serialize(objMemStream, obj)
objMemStream.Seek(0, SeekOrigin.Begin)
ObjectCopy = objBinaryFormatter.Deserialize(objMemStream)
objMemStream.Close()
End Function
Good.
ReplyDeletethanx sir :)
ReplyDelete