public static bool isIneternetConnected() { try { System.Net.IPHostEntry ipHostEntry = System.Net.Dns.GetHostEntry("www.google.com"); } catch (SocketException) { return false; } return true; }