locked
Ping ips from txt problem RRS feed

  • Question

  • Hello all, Im reading an ips list from .txt and ping each one but with my code im allways pinging the same ip... Cant figure out why.

        Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
            For ip = 0 To ListBox1.Items.Count - 1
                Dim delimited() As String = ListBox1.Items(ip).Split("-")
                If My.Computer.Network.Ping(delimited(ip)) Then
                    MsgBox(delimited(ip))
                    Label3.Text = delimited(ip) & " OK!"
                Else
                    ListBox2.Items.Add(delimited(ip) & "-" & delimited(1))
                    bads = bads + 1
                    Label2.Text = "Not Working: " & bads
                End If
            Next ip
        End Sub

    Saturday, June 13, 2020 6:41 PM

All replies

  • Maybe instead of delimited(ip) you should use a constant, such as delimited(0) or delimited(1). Show an example of your listbox items.

    Saturday, June 13, 2020 8:18 PM
  • For example 192.1.1.1-Server1

    Saturday, June 13, 2020 10:11 PM
  • For example 192.1.1.1-Server1

    Then try delimited(0) instead of delimited(ip).


    Sunday, June 14, 2020 2:41 AM