Imports System.IO Imports System.Runtime.Serialization.Formatters Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim MyArray As New ArrayList Dim ReadBack As New ArrayList MyArray.Add("Bobbi") MyArray.Add("Franci") MyArray.Add("Mysti") MsgBox(MyArray(2)) Dim fs As New FileStream("c:\test.txt", FileMode.Create, FileAccess.Write) Dim XMLfrm As New Soap.SoapFormatter XMLfrm.Serialize(fs, MyArray) fs.Close() 'read back the ArrayList Dim XMLfrm1 As New Soap.SoapFormatter Dim fs1 As New FileStream("c:\test.txt", FileMode.Open, FileAccess.Read) ReadBack = XMLfrm1.Deserialize(fs1) fs1.Close() MsgBox(ReadBack(1)) End Sub |