To get started, you can sign up for ISensIntf to check if you have a working network connection. (Let me know if you need help with this. It hurts to register for events, etc.). After that, you can use Api, such as IsNetworkAlive , InternetGetConnectedStateEx or InternetCheckConnection , to check your Internet connection, etc.
If you are using C # or VB, first add a link to
Microsoft.VisualBasic.Code. Microsoft.VisualBasic.Devices.Network network = new Microsoft.VisualBasic.Devices.Network(); network.NetworkAvailabilityChanged += new Microsoft.VisualBasic.Devices.NetworkAvailableEventHandler(network_NetworkAvailabilityChanged); ... private static void network_NetworkAvailabilityChanged(object sender, Microsoft.VisualBasic.Devices.NetworkAvailableEventArgs e) { if (e.IsNetworkAvailable) { //network is connected.. do something.. } else { //network isnt connected.. do something else. }
Hope this helps
macdnelson
source share