Welcome! and rules
Joel on Software
detect when network cable is disconnected
How can I write a program to detect when my network connection fails (such as somebody disconnecting the cable)? I don't want to have to poll network sites or any of that monkey business. I just want a function triggered in my code when the network goes out. There's gotta be a way to do it: win2k shows a little icon in the sys tray when you unplug your network cable.
http://www.dotnet247.com/247reference/msgs/21/105555.aspx may help you a little. But the key is that yes, it's only win2k and above, and rather undocumented... my guess is that if you went seriously hardware deep, you could do it inless, but i don't think that's something you want to be doing!
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=OcMIgb2ACHA.2308%40tkmsftngp02&rnum=36&prev=/groups%3Fq%3Ddetect%2Bnetwork%2Bconnection%2Bwindows%2Btray%26num%3D20%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26start%3D20%26sa%3DN has some WMI code for this.
Fog Creek Home