none
VB.Net System.IndexOutOfRangeException: 'Index was outside the bounds of the array.' RRS feed

  • Question

  • Heres a picture of the code,
    I dont know what to do.

    Public Sub Login()
            Dim index As Integer = 0
            While index < Combos.Count
                Dim str() As String = Combos(index).Split(" - $")
                Dim money As Integer
                money = Val(str(1))
                If money > 24.99 Then
                    Dim IT As New ListViewItem
                    IT.Text = str(0)
                    IT.SubItems.Add(str(1))
                    ListView1.Items.Add(IT)
                ElseIf money < 25.0 Then
                    Label2.Text = money
                End If
                Label1.Text += 1
                index += 1
            End While
        End Sub

    I want to make it to check the file first part and second part i already split the file.
    The file looks like this: 28246000013193 - $0.87
    Friday, July 26, 2019 5:10 AM

All replies