public static bool InternetConnection()
{
try
{
System.Net.IPHostEntry host =
System.Net.Dns.GetHostEntry("www.google.com");
return true;
}
catch
{
return false;
}
}
regresa true si se pudo conectar.