Serialize an object and write it to the disk

/ Published in: VB.NET
Save to your folder(s)

Serializes any object and writes it to the specified location on the disk.


Dim obj As DataTable
'save obj to disk
SerializeToFile(filepath, obj)
'to read it back, use DirectCast
Dim obj2 As DataTable = DirectCast(My.Computer.FileSystem.ReadAllBytes(filepath), DataTable)

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.