Hi,
Try:
Dim value As String() = My.Computer.FileSystem.ReadAllText(Directory).Skip(4).ToArray()
[EDIT]
FileSystem.ReadAllText
returns a string, and you skip some chars. If you call the
ToArray
method, you get an array of
Char
s.
So, try this:
Dim value As String = New String(My.Computer.FileSystem.ReadAllText(Directory).Skip(4).ToArray())
ListBox1.Items.Add(value)
The
Add
method adds a single value to the
ListBox
.
[EDIT #2]
sampleme90 wrote:
it only imports in to the listbox only one line and that is the first line i got a feeling it is bacause of the readalltext and i am wanting something like readalllines
Instead of the
My.Computer.FileSystem.ReadAllText
method, you can use the
System.IO.File.ReadAllLines[
^] method:
Dim value As String() = System.IO.File.ReadAllLines(Directory)
ListBox1.Items.AddRange(value)
Hope this helps.