You can use this code sample for finding connection state of network in C# or you can check your network connection.
using System.Runtime.InteropServices;
[DllImport("wininet.dll", CharSet = CharSet.Auto)] static extern bool InternetGetConnectedState(ref ConnectionState lpdwFlags, int dwReserved); [Flags] enum ConnectionState : int { INTERNET_CONNECTION_MODEM = 0x1, INTERNET_CONNECTION_LAN = 0x2, INTERNET_CONNECTION_PROXY = 0x4, INTERNET_RAS_INSTALLED = 0x10, INTERNET_CONNECTION_OFFLINE = 0x20, INTERNET_CONNECTION_CONFIGURED = 0x40 } private bool IsNetConnected() { ConnectionState conn = new ConnectionState(); bool IsInternetConnected = InternetGetConnectedState(ref conn, 0); return IsInternetConnected; }