Which version of VB. If .Net, I'd use this (assuming that all user names and passwords are stored in a single list box):
Write list to file:
'Declare string variable 'CompleteList' for storing the conetnts of the listbox
Dim CompleteList As String
'Per user in the listbox
For Each User As String In List.Items
'If it is the first user
If CompleteList = "" Then
'Add the User to the list string
CompleteList = User
'Any other time
Else
'Add the User to the list string in a new line
CompleteList = CompleteList & vbCrLf & User
End If
Next
'Write the list to this file
My.Computer.FileSystem.WriteAllText("YOUR FILES NAME", CompleteList, False)
Read file back to list box
'Create a FileStream to access your file
Dim FS As New FileStream("YOUR FILES NAME", FileMode.Open, FileAccess.Read, FileShare.Inheritable)
'Create a streamreader to read data line by line from your file
Dim SR As New StreamReader(FS)
'Loop until the file has ended
Do
'Read a line and add its contents to the listbox
List.Items.Add(SR.ReadLine)
Loop Until SR.EndOfStream
'Release system resources, vital for good performance and security
SR.Close()
FS.Close()
Put this before your class
Option Explicit On
Imports System.Text
Imports System.Windows
Imports System.IO
Hope that helped