18,356
社区成员
发帖
与我相关
我的任务
分享
#ifndef WINVER // 指定要求的最低平台是 Windows Vista。
#define WINVER 0x0600//改成0x0501 // 将此值更改为相应的值,以适用于 Windows 的其他版本。
#endif
#ifndef _WIN32_WINNT // 指定要求的最低平台是 Windows Vista。
#define _WIN32_WINNT 0x0600//改成0x0501 // 将此值更改为相应的值,以适用于 Windows 的其他版本。
#endif
#if _WIN32_WINNT >= 0x0502
#include <atlsocket.h> //Windows Vista用这个头文件
#else
#include <winsock2.h>
#include <mswsock.h>
#endif // _WIN32_WINNT