using System.Net.Sockets;
using System.Net.NetworkInformation;
public partial class Form1 : Form
[DllImport("winnet.dll")]
private extern static bool InternetGetConnectedState(out int Description, int ReservedvValue);
public static bool IsConnected()
return InternetGetConnectedState(out Desc, 0);
else{ MessageBox.Show("False");}