Serializing can be used to directly write the data properties of the Tutorial class to a file. Deserialization is used to read the data from the file and construct the Tutorial object again.
This sample show serialize and deserialize by use binary format.
' Create file by FileStream class Dim fs As FileStream = New FileStream(""c:\test.bin"", FileMode.OpenOrCreate)
' Creat binary object Dim bf As New BinaryFormatter()
' Serialize object to file bf.Serialize(fs, pPerson) fs.Close()
' Open file and deserialize to object again Dim fsRead As New FileStream(""C:\test.bin"", FileMode.Open) Dim objTest As Object = bf.Deserialize(fsRead) fsRead.Close()