Dim objBinFormatter As New BinaryFormatter Try objStream = File.Open("Empdata.bin", FileMode.Create) objBinFormatter.Serialize(objStream, Me) objStream.Close() objStream = File.Open("Empdata.bin", FileMode.Open) objEmpCopy = CType(objBinFormatter.Deserialize(objStream), CEmpData) objStream.Close() CreateDeepCopy = objEmpCopy Catch ex As Exception MsgBox(ex.ToString) End Try End Function Public Sub GetObjectData(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext) Implements System.Runtime.Serialization.ISerializable.GetObjectData Dim intIndex As Integer Dim objEmp As CEmp info.AddValue("emp_count", ArrEmp.Count) For intIndex = 0 To ArrEmp.Count - 1 objEmp = ArrEmp(intIndex) objEmp.GetObjectData(info, context, intIndex) Next End Sub Public Function GetEmpData() As String Dim intCount As Integer Dim strEmpData As String For intCount = 0 To ArrEmp.Count - 1 strEmpData = strEmpData & CType(ArrEmp(intCount), CEmp).FName & Chr(9) & CType(ArrEmp(intCount), CEmp).LName & Chr(13) Next GetEmpData = strEmpData |