I'm trying do do something that on the face of it should be pretty easy,basically I'm trying to ping a range of IP addresses and list the ones that respond in a listbox.
The code below actually does ping the ip addresses and lists the ones that respond in the listbox but there are a few problems.

1. the IP addresses that respond are only listed when the whole process is complete, what I want it to do is add the address as it responds so a list is 'seen' to be created.

2.The label that should show the current address being pinged doesn't, it just shows the final address, again this happens when the whole process is complete.

3. Finally and most seriously the process takes and absolute age to complete, even if i set the time out in My.Computer.Network.Ping to 10ms, I've really no idea why its taking so long, according to the info in VS2005 express help it seems that only one atempt is made to contact the address so the whole process should complete in around 3 seconds but it's more like 2 mins

VB Code:
  1. Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
  2.         Dim i As Integer
  3.         Dim strIP As String
  4.         For i = 1 To 254
  5.             strIP = txtSubNet.Text & "." & i
  6.             'display the current IP address being pinged
  7.             lblCurrentPing.Text = strIP
  8.             If My.Computer.Network.Ping(strIP) Then
  9.                 'if the IP address responded add to the listbox
  10.                 lstIPaddress.Items.Add(strIP)
  11.             End If
  12.         Next
  13.     End Sub

any help greatly appreciated