Network Discovery

  • Thread starter Thread starter Nicolas
  • Start date Start date
N

Nicolas

Basically I got a LAN with several computer.
From Computer A I'll got my appliation which should do the following:
Check if any other computer lost connection to the network. (Computer B may
has been shutdown, While computer C cable has been unplug, etc.).

I used to check if a file exist on each computer by running a loop. This way
is to slow and too much CPU demanding for nothing.

Is there anty other way like a listener of some sort to catch connection
lost from other computer into the network. (Eventually I may know the IP or
computer name that I want to check).

Thank you.
 
use a timer

ub pingg(ByVal adress As String, ByVal timeout As Int32)
If My.Computer.Network.IsAvailable Then
Try
If My.Computer.Network.Ping(adress, timeout) Then
MsgBox(adress & vbCrLf & "ok", MsgBoxStyle.Information,
Me.Text)
Else
MsgBox(adress & vbCrLf & "failled",
MsgBoxStyle.Exclamation, Me.Text)
End If
Catch ex As Exception
MessageBox.Show(ex.Message, Me.Text, MessageBoxButtons.OK,
MessageBoxIcon.Error)
End Try
End If
End Sub
 
Back
Top