using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Threading.Tasks; namespace HKCardIN.Helper { public class HKHelper: Singleton { /// /// 判断网络状况的方法,返回值true为连接,false为未连接 /// /// /// /// [DllImport("wininet")] public extern static bool InternetGetConnectedState(out int conState, int reder); /// /// 获取当前网络连接状态 /// /// 成功连接网络返回 true,未连接返回 false public bool GetNetworkState() { return InternetGetConnectedState(out int i, 0); } } }