随笔 - 303  文章 - 883  trackbacks - 0
<2007年11月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

欢迎光临! 
闲聊 QQ:1074961813

随笔分类(357)

我管理的群

公共blog

  • n维空间
  • Email : java3d@126.com 群 : 12999758

参与管理的论坛

好友的blog

我的其他blog

朋友的网站

搜索

  •  

最新评论

代码:

#pragma comment(lib,"Ws2_32.lib")
#include
<winsock2.h>
#include
<iostream.h>

void print(WSADATA wsaData)
{     
      cout
<<wsaData.iMaxSockets<<endl;
      cout
<<wsaData.iMaxUdpDg<<endl;
      cout
<<wsaData.szDescription<<endl;
      cout
<<wsaData.szSystemStatus<<endl;
      cout
<<wsaData.wHighVersion<<endl;
      cout
<<wsaData.wVersion<<endl;
}


void main(void)
{
   WSADATA wsaData; 
   
int Ret;

   
if (0 != (Ret = WSAStartup(MAKEWORD(2,2), &wsaData)))
   
{
       cout
<<"WSAStartup failed with error "<<Ret<<endl;
       
return;
   }

   
else
   
{
       print(wsaData);
   }

   
   
if (SOCKET_ERROR == WSACleanup())
   
{
       cout
<<"WSACleanup failed with error "<<WSAGetLastError()<<endl;
       
return;
   }

   
return ;
}
 

运行结果:
0
0
WinSock 2.0
Running
514
514
Press any key to continue


地震让大伙知道:居安思危,才是生存之道。
posted on 2007-11-24 13:08 小寻 阅读(607) 评论(0)  编辑  收藏 所属分类: c/c++/C#/pasic/vb/php/asp(.net)/win-cgi/xml...

只有注册用户登录后才能发表评论。


网站导航: