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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.