NetworkAddressChanged Occurs when the IP address of a network interface changes. NetworkAvailabilityChanged Occurs when the availability of the network changes
[DllImport("wininet.dll")]
privateexternstaticbool InternetGetConnectedState(outint connectionDescription, int reservedValue);
publicbool IsInternetConnected()
{
int i =0;
return InternetGetConnectedState(out i, 0);
}