摘要: 1、用InternetGetConnectedState函数 这个函数有一个缺点就是不及时,要过几秒才能反应过来。2、用IsNetworkAlive函数 可以及时反应网络连通情况,但是需要服务System Event Notification支持(系统默认自动启动该服务)。使用该函数,需要安装最新的SDK(如.net的)两种方式的代码如下,从其它地方找的,已经测试过。[DllImport("winInet.dll")] private static extern bool InternetGetConnectedState(ref int dwFlag, int dwRes 阅读全文
posted @ 2013-07-31 09:41 xfyn 阅读(799) 评论(0) 推荐(0) 编辑