Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Network disconnect

Network disconnect

Scheduled Pinned Locked Moved C#
sysadmin
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michaelgr1
    wrote on last edited by
    #1

    Hello, I am looking for a way to capture network disconnection without sampling connection status every couple of minutes . I am trying to do some function when network is back connected.

    P L 2 Replies Last reply
    0
    • M michaelgr1

      Hello, I am looking for a way to capture network disconnection without sampling connection status every couple of minutes . I am trying to do some function when network is back connected.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Without knowing which version of Windows you are targetting, we can't really give you a definitive answer as network connectivity monitoring was enhanced post XP. A good starter, though, is this[^] article. Pay attention to the comments which link out to the Code Pack - this includes networking samples you can modify as you see fit.

      *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

      M 1 Reply Last reply
      0
      • P Pete OHanlon

        Without knowing which version of Windows you are targetting, we can't really give you a definitive answer as network connectivity monitoring was enhanced post XP. A good starter, though, is this[^] article. Pay attention to the comments which link out to the Code Pack - this includes networking samples you can modify as you see fit.

        *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

        "Mind bleach! Send me mind bleach!" - Nagy Vilmos

        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

        M Offline
        M Offline
        michaelgr1
        wrote on last edited by
        #3

        Hi, First of all i have Win7 secondly, I found there is an event- NetworkChange.NetworkAvailabilityChanged which is in NetworkInformation namespace . This event raised when network connection status is changed . Is it a good way to use this?

        P 1 Reply Last reply
        0
        • M michaelgr1

          Hi, First of all i have Win7 secondly, I found there is an event- NetworkChange.NetworkAvailabilityChanged which is in NetworkInformation namespace . This event raised when network connection status is changed . Is it a good way to use this?

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          It's one way to do it, but I have found under certain circumstances that it's not 100% reliable (for instance, I know of people who have found it not to work with static IP addresses when detecting reconnects).

          *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

          "Mind bleach! Send me mind bleach!" - Nagy Vilmos

          My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

          1 Reply Last reply
          0
          • M michaelgr1

            Hello, I am looking for a way to capture network disconnection without sampling connection status every couple of minutes . I am trying to do some function when network is back connected.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Have a look at this http://blog.superuser.com/2011/05/16/windows-7-network-awareness/[^] Explains how MS does it, and how you can set up your own server to check. Good luck :)

            Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups