Dobrý deň!!
Mám tento kód, ale stále mi vypisuje pri uložený "index je mimo hranice poľa" dá sa stým niečo robiť? Ďakujem!!!
Public Class Form1
Private TextFile1 As String = Application.StartupPath & "\TextFile1.txt"
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dialog1.ShowDialog(Me)
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
ListView1.Items.Clear()
Dim myCoolFileLines() As String = IO.File.ReadAllLines(TextFile1)
For Each Line As String In myCoolFileLines
Dim lineArrary() As String = Line.Split("#")
Dim newItem As New ListViewItem(lineArrary(0))
newItem.SubItems.Add(lineArrary(1))
newItem.SubItems.Add(lineArrary(2))
ListView1.Items.Add(newItem)
Next
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
ListView1.Items.Clear()
Dim myCoolFileLines() As String = IO.File.ReadAllLines(TextFile1)
For Each Line As String In myCoolFileLines
Dim lineArrary() As String = Line.Split("#")
Dim newItem As New ListViewItem(lineArrary(0))
newItem.SubItems.Add(lineArrary(1))
newItem.SubItems.Add(lineArrary(2))
ListView1.Items.Add(newItem)
Next
End Sub