博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
检测网络状态
阅读量:4549 次
发布时间:2019-06-08

本文共 1899 字,大约阅读时间需要 6 分钟。

///         /// Retrieves the connected state of the local system        ///         /// Pointer to a variable that receives the connection description. This parameter may return a valid flag even when the function returns FALSE. This parameter can be one or more of the following values.        /// This parameter is reserved and must be 0.        /// 
Returns TRUE if there is an active modem or a LAN Internet connection, or FALSE if there is no Internet connection, or if all possible Internet connections are not currently active. For more information, see the Remarks section. /// When InternetGetConnectedState returns FALSE, the application can call GetLastError to retrieve the error code
[DllImport("wininet.dll", EntryPoint = "InternetGetConnectedState")] public extern static bool InternetGetConnectedState(out StateFlags lpdwFlags, int dwReserved); public enum StateFlags : int { /// /// Local system uses a modem to connect to the Internet. /// INTERNET_CONNECTION_MODEM = 0x01, /// /// Local system uses a local area network to connect to the Internet. /// INTERNET_CONNECTION_LAN = 0x02, /// /// Local system uses a proxy server to connect to the Internet. /// INTERNET_CONNECTION_PROXY = 0x04, /// /// No longer used. /// INTERNET_CONNECTION_MODEM_BUSY = 0x08, /// /// Local system has RAS installed. /// INTERNET_RAS_INSTALLED = 0x10, /// /// Local system is in offline mode. /// INTERNET_CONNECTION_OFFLINE = 0x20, /// /// Local system has a valid connection to the Internet, but it might or might not be currently connected. /// INTERNET_CONNECTION_CONFIGURED = 0x40 }

 

转载于:https://www.cnblogs.com/wjshan0808/p/4221607.html

你可能感兴趣的文章
【Codeforces Round #455 (Div. 2) A】Generate Login
查看>>
【Codeforces 476C】Dreamoon and Sums
查看>>
【codeforces 505C】Mr.Kitayuta,the Treasure Hunter
查看>>
混合应用 微信登录授权 微信登录认证失败 ios PGWXAPI错误-1 code:-100 / 安卓 message:invalid appsecret innerCode:40125...
查看>>
MSSQL按分页前去盘查了局的存储进程
查看>>
wxDownload Fast 0.4.5
查看>>
<实训|第十天>从底层解释一下U盘内存为什么变小的原因附数据恢复的基本原理...
查看>>
文件下载工具类
查看>>
Python 定义自己的常量类
查看>>
C++读取文本文件
查看>>
Python 字典排序
查看>>
sql中写标量函数生成大写拼音首字母
查看>>
ASP.NET Core 2.1 : 十五.图解路由(2.1 or earler)
查看>>
服务器返回状态码说明
查看>>
GitHub for Windows提交失败“failed to sync this branch”
查看>>
linux 安装 git
查看>>
Margin
查看>>
完成登录与注册页面的前端
查看>>
centos 源码安装php7
查看>>
Log4j详细教程
查看>>