This article has been dead for over three months
You
// Required using statement:
using System.Runtime.InteropServices;
public class LAN
{
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState(out int desc, int reserved);
public enum ConnectionState
{
Connected,
Disconnected
}
public ConnectionState InternetConnection
{
get
{
ConnectionState Connection = ConnectionState.Disconnected;
int desc = 0;
if (InternetGetConnectedState(out desc, 0))
Connection = ConnectionState.Connected;
return Connection;
}
}
}