[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

C# way to detect if wifi or ethernet connection has gone down

Posted on 2014-08-20
3
Medium Priority
?
2,212 Views
Last Modified: 2014-08-29
Hi

I have  client/Server applications written in c#. I need a good way to detect if the clients wifi or Ethernet connect to the internet has gone down to our server? What would be the best way to do this?

Thank you.
0
Comment
Question by:SkyMagic
3 Comments
 
LVL 37

Expert Comment

by:Kimputer
ID: 40275809
I'd say the best way is to ping the default gateway at the active connection at a regular interval (not too heavy though, maybe every minute or so).
0
 
LVL 31

Accepted Solution

by:
MlandaT earned 2000 total points
ID: 40292908
A solution for this you can add handlers to the static NetworkAddressChanged and NetworkAvailabilityChanged events implemented by the System.Net.NetworkInformation.NetworkChange class.

see here:
http://www.ultradevelopers.net/Blog/20
http://learningcsharpe.blogspot.com/2010/06/detect-changes-in-network-connectivity.html
0
 

Author Closing Comment

by:SkyMagic
ID: 40293340
Thank you.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Six Sigma Control Plans

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question