Providing Serialization for Custom Objects

You can make your custom objects serializable so that you can apply the previously described techniques for persisting and re-creating objects’ state. To be serializable, a class (or structure) must be decorated with the Serializable attribute. This is the most basic scenario and is represented by the following implementation of the Person class:

Imports System.Runtime.Serialization<Serializable()>Public Class Person    Public Property FirstName As String    Public Property LastName As String    Public Property Age As Integer    Public Property Address As StringEnd Class

If you do not need to get control over the serialization process, this is all you need. By the way, there ...

Get Visual Basic 2015 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.