vc 网络连接的测试方法
来源:互联网 发布:狸窝ppt转换器 mac 编辑:程序博客网 时间:2024/04/28 23:11
- //
- #include "stdafx.h"
- #include "windows.h"
- #include <Sensapi.h>
- #include <iostream>
- #include <Wininet.h>
- #pragma comment(lib, "Sensapi.lib")
- #pragma comment(lib, "Wininet.lib")
- using namespace std;
- int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
- {
- BOOL isConnect;
- DWORD dw;
- isConnect = ::IsNetworkAlive( &dw );
- while (1)
- {
- if(isConnect)
- cout << "IsNetworkAlive连接" <<endl;
- else
- cout << "IsNetworkAlive未连接" <<endl;
- cout<< "---------------------------------" <<endl;
- DWORD dw2;
- BOOL ret = InternetGetConnectedState(&dw2, 0);
- if (ret)
- cout << "InternetGetConnectedState连接" <<endl;
- else
- cout << "InternetGetConnectedState未连接" <<endl;
- cout<< "**********************************" <<endl;
- BOOL bConnected = InternetCheckConnection(_T("http://www.baidu.com"), FLAG_ICC_FORCE_CONNECTION, 0);
- if (bConnected)
- cout << "InternetCheckConnection连接" <<endl;
- else
- cout << "InternetCheckConnection未连接" <<endl;
- cout<< "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" <<endl;
- //IsDestinationReachable(_T("http://www.google.com"), )
- cout<<endl<<endl<<endl;
- Sleep(1000);
- }
- getchar();
- return 1;
- }
转自:http://blog.csdn.net/qyee16/article/details/8167466
0 0
- vc 网络连接的测试方法
- vc 网络连接的测试方法
- vc 网络连接的测试方法
- vc 网络连接的测试方法
- vc连接SQL的方法
- vc连接数据库的方法
- vc连接数据库的方法
- IP网络的测试方法
- IP网络的测试方法
- 一个测试网络连接的批处理
- 测试网络连接状态的批处理
- VC用ADO连接oracle的方法
- 使用VC连接Access数据库的方法
- VC用ADO连接oracle的方法 .
- ping网络连接测试
- 图片测试网络连接
- 测试网络是否连接
- 测试网络连接状态
- Delaunay三角剖分
- 如何使用Git上传项目代码到github
- hdu 3247(ac自动机+状态压缩dp+最短路)
- mongodb安装初步
- Android getDimensionPixelSize, 代码中设置字体大小,读xml配置。
- vc 网络连接的测试方法
- oracle按时间段查询
- MATLAB中的分类器
- iOS 被键盘遮挡时,带有textfield的tableview自动上移
- 请问两个div之间的上下距离怎么设置
- 抓取网页信息并获取生成xml文件(以网页彩票数据为例)
- android中actionBar中字体颜色设置
- LintCode:最小路径和
- 【IOS 开发学习总结-OC-39】★★ios开发之 MVC 模式