using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; namespace ConnectPoint { class NetWork { //检测网络状态 [DllImport("wininet.dll", EntryPoint = "InternetGetConnectedState")] public extern static bool InternetGetConnectedState(out int conState, int reder); public static bool jiance() { int Desc = 0; return InternetGetConnectedState(out Desc, 0); } } }