[DllImport("wininet.dll")] private extern static bool InternetGetConnectedState(out int Description, int ReservedValue); public static bool IsConnected() { try { int ConnDesc; return InternetGetConnectedState(out ConnDesc, 0); } catch { return false; } }
using OpenNETCF.Net.NetworkInformation; bool result = false; Ping ping = new Ping(); PingReply pingReply = ping.Send("www.google.com"); if (pingReply.Status == IPStatus.Success) result = true;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)