Network Discovery

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Tmljb2xhcw==?=

    Network Discovery

    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.


  • Gillard

    #2
    Re: Network Discovery

    use a timer

    ub pingg(ByVal adress As String, ByVal timeout As Int32)
    If My.Computer.Net work.IsAvailabl e Then
    Try
    If My.Computer.Net work.Ping(adres s, timeout) Then
    MsgBox(adress & vbCrLf & "ok", MsgBoxStyle.Inf ormation,
    Me.Text)
    Else
    MsgBox(adress & vbCrLf & "failled",
    MsgBoxStyle.Exc lamation, Me.Text)
    End If
    Catch ex As Exception
    MessageBox.Show (ex.Message, Me.Text, MessageBoxButto ns.OK,
    MessageBoxIcon. Error)
    End Try
    End If
    End Sub

    "Nicolas" <Nicolas@discus sions.microsoft .comwrote in message
    news:0750C864-C486-405F-8EB6-4030176D0D2E@mi crosoft.com...
    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.
    >
    >

    Comment

    • =?Utf-8?B?Tmljb2xhcw==?=

      #3
      Re: Network Discovery

      Is there any other way then a Timer since it's doing a loop which could run
      for days.

      "Gillard" wrote:
      use a timer
      >
      ub pingg(ByVal adress As String, ByVal timeout As Int32)
      If My.Computer.Net work.IsAvailabl e Then
      Try
      If My.Computer.Net work.Ping(adres s, timeout) Then
      MsgBox(adress & vbCrLf & "ok", MsgBoxStyle.Inf ormation,
      Me.Text)
      Else
      MsgBox(adress & vbCrLf & "failled",
      MsgBoxStyle.Exc lamation, Me.Text)
      End If
      Catch ex As Exception
      MessageBox.Show (ex.Message, Me.Text, MessageBoxButto ns.OK,
      MessageBoxIcon. Error)
      End Try
      End If
      End Sub
      >
      "Nicolas" <Nicolas@discus sions.microsoft .comwrote in message
      news:0750C864-C486-405F-8EB6-4030176D0D2E@mi crosoft.com...
      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.
      >

      Comment

      • James Hahn

        #4
        Re: Network Discovery

        This has already been done in several places, and you may be able to get
        some ideas. See, for instance:


        You should also consider whether you can use the facilities of .Net, such as
        the FileSystemWatch er class.

        "Nicolas" <Nicolas@discus sions.microsoft .comwrote in message
        news:0750C864-C486-405F-8EB6-4030176D0D2E@mi crosoft.com...
        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.
        >
        >

        Comment

        • Gillard

          #5
          Re: Network Discovery

          use a loop with a process.sleep

          "Nicolas" <Nicolas@discus sions.microsoft .comwrote in message
          news:9A30F255-2DC8-410E-9396-0C061AE210BB@mi crosoft.com...
          Is there any other way then a Timer since it's doing a loop which could
          run
          for days.
          >
          "Gillard" wrote:
          >
          >use a timer
          >>
          >ub pingg(ByVal adress As String, ByVal timeout As Int32)
          > If My.Computer.Net work.IsAvailabl e Then
          > Try
          > If My.Computer.Net work.Ping(adres s, timeout) Then
          > MsgBox(adress & vbCrLf & "ok",
          >MsgBoxStyle.In formation,
          >Me.Text)
          > Else
          > MsgBox(adress & vbCrLf & "failled",
          >MsgBoxStyle.Ex clamation, Me.Text)
          > End If
          > Catch ex As Exception
          > MessageBox.Show (ex.Message, Me.Text,
          >MessageBoxButt ons.OK,
          >MessageBoxIcon .Error)
          > End Try
          > End If
          > End Sub
          >>
          >"Nicolas" <Nicolas@discus sions.microsoft .comwrote in message
          >news:0750C86 4-C486-405F-8EB6-4030176D0D2E@mi crosoft.com...
          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.
          >
          >
          >>

          Comment

          • Gillard

            #6
            Re: Network Discovery

            sorry
            Threading.Threa d.Sleep(1000)


            "Gillard" <gillard_george s@@@@@@@@@hotma il.comwrote in message
            news:eSiAF$HIJH A.4408@TK2MSFTN GP06.phx.gbl...
            use a loop with a process.sleep
            >
            "Nicolas" <Nicolas@discus sions.microsoft .comwrote in message
            news:9A30F255-2DC8-410E-9396-0C061AE210BB@mi crosoft.com...
            >Is there any other way then a Timer since it's doing a loop which could
            >run
            >for days.
            >>
            >"Gillard" wrote:
            >>
            >>use a timer
            >>>
            >>ub pingg(ByVal adress As String, ByVal timeout As Int32)
            >> If My.Computer.Net work.IsAvailabl e Then
            >> Try
            >> If My.Computer.Net work.Ping(adres s, timeout) Then
            >> MsgBox(adress & vbCrLf & "ok",
            >>MsgBoxStyle.I nformation,
            >>Me.Text)
            >> Else
            >> MsgBox(adress & vbCrLf & "failled",
            >>MsgBoxStyle.E xclamation, Me.Text)
            >> End If
            >> Catch ex As Exception
            >> MessageBox.Show (ex.Message, Me.Text,
            >>MessageBoxBut tons.OK,
            >>MessageBoxIco n.Error)
            >> End Try
            >> End If
            >> End Sub
            >>>
            >>"Nicolas" <Nicolas@discus sions.microsoft .comwrote in message
            >>news:0750C8 64-C486-405F-8EB6-4030176D0D2E@mi crosoft.com...
            >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.
            >>
            >>
            >>>

            Comment

            • Cor Ligthert[MVP]

              #7
              Re: Network Discovery

              Nicolas,

              In my idea is for this Directory Services.

              Be aware the the documentation around it is still fair.



              (As you use HDLC then you have no fixex IP addresses that you can ping)



              Cor

              "Nicolas" <Nicolas@discus sions.microsoft .comschreef in bericht
              news:0750C864-C486-405F-8EB6-4030176D0D2E@mi crosoft.com...
              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.
              >
              >

              Comment

              Working...