// TestNetConnection.cpp : Defines the entry point for the console application. // // test.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <windows.h> #include <iostream> using namespace std; #include <Wininet.h> #pragma comment (lib, "Wininet.lib") #include <Sensapi.h> #pragma comment (lib, "Sensapi.lib") /* //本机网络连接类型(成功) #define NET_TYPE_RAS_DIAL_UP_CONNECT_NET 0x01 //上网类型:采用RAS拨号连接上网 0x01 #define NET_TYPE_LAN_CONNECT_NET 0x02 //上网类型:采用网卡通过局域网上网 0x02 #define NET_TYPE_PROXY_CONNECT_NET 0x04 //上网类型:使用代理服务器上网 0x04 #define NET_TYPE_RAS_INSTALL 0x10 //RAS安装 0x10 */ void Fun_InternetGetConnectedState() { DWORD flags;//上网方式 BOOL m_bOnline=TRUE;//是否在线 m_bOnline=InternetGetConnectedSt