用API测试是否连接网络!
2011-11-26 08:54
246 查看
uses Wininet; {$R *.dfm} function NetWorkIsConnect(Url:string='http://www.microsoft.com/'): Boolean; var ConTypes : Integer; begin Result := false; ConTypes := INTERNET_CONNECTION_MODEM + INTERNET_CONNECTION_LAN + INTERNET_CONNECTION_PROXY; if InternetGetConnectedState(@ConTypes, 0) then //ConTypes := $01 + $02 + $04; Result := True else if InternetCheckConnection(PWideChar(Url), 1, 0) then Result := True; end;
相关文章推荐
- Android检查设备是否可以访问互联网,判断Internet连接,测试网络请求,解析域名
- Android测试网络是否连接
- PB程序中如何测试网络连接是否中断?(实现Ping命令)
- PB程序中如何测试网络连接是否中断?
- 测试网络是否连接
- ios 测试网络是否连接
- Android测试网络是否连接
- 安卓下测试网络连接是否可用的问题
- 在PB程序中如何测试网络连接是否中断
- java测试网络连接是否成功并设置超时时间
- PB程序中如何测试网络连接是否中断?(实现Ping命令)
- 测试网络是否联通 telnet
- C#检查网络是否连接的方法
- android 开发中判断网络是否连接的代码
- 如何判断当前网络连接状态(网络是否正常)
- Android中判断网络连接是否可用及监控网络状态
- 判断是否连接网络以及是否是局域网
- 测试php连接mysql是否成功的代码分享
- 用C#实现实现简单的 Ping 的功能,用于测试网络是否已经联通
- 判断是否有网,判断网络连接,跳转至设置