Hi any1 know how to populate a listbox from a textfile using split plz? 10x alot
Below a code extract
Private Sub LoadAlbum()
With ofdAlbum
.DefaultExt = "txt"
.InitialDirectory = "C:\Documents and Settings\My Pictures\"
.Filter = "Text files | *.txt"
.ShowDialog() 'get the filename of the picture the user wants
End With
Dim FileName As String = IO.Path.GetFileName(ofdAlbum.FileName) 'Getting the Filename
Dim FolderPath As String = ofdAlbum.InitialDirectory 'Establishing the Folder path
Dim StrReader As New StreamReader(FolderPath & FileName) 'Enables to upload a textfile album
Dim EndOfFile, CurrentPhoto, i As Integer
Dim IndexFile As String
Dim SplitIndexFile, SplitPictureInfo As String()
IndexFile = StrReader.ReadToEnd
StrReader.Close()
SplitIndexFile = IndexFile.Split("|")
EndOfFile = SplitIndexFile.Length - 3
lstImages.Items.Clear() 'clears the list box
Below a code extract
Private Sub LoadAlbum()
With ofdAlbum
.DefaultExt = "txt"
.InitialDirectory = "C:\Documents and Settings\My Pictures\"
.Filter = "Text files | *.txt"
.ShowDialog() 'get the filename of the picture the user wants
End With
Dim FileName As String = IO.Path.GetFileName(ofdAlbum.FileName) 'Getting the Filename
Dim FolderPath As String = ofdAlbum.InitialDirectory 'Establishing the Folder path
Dim StrReader As New StreamReader(FolderPath & FileName) 'Enables to upload a textfile album
Dim EndOfFile, CurrentPhoto, i As Integer
Dim IndexFile As String
Dim SplitIndexFile, SplitPictureInfo As String()
IndexFile = StrReader.ReadToEnd
StrReader.Close()
SplitIndexFile = IndexFile.Split("|")
EndOfFile = SplitIndexFile.Length - 3
lstImages.Items.Clear() 'clears the list box