小彭屋

导航

2013年2月26日 #

能够自动获取本机的ip地址代码

摘要: #include<stdio.h> //头文件,大家都会吧#include<winsock2.h>#pragma comment(lib,"ws2_32.lib")void CheckIP(void){WSADATA wsaData;char name[155];char *ip;PHOSTENT hostinfo;if ( WSAStartup( MAKEWORD(2,0), &wsaData ) == 0 ) {if( gethostname ( name, sizeof(name)) == 0) {if((hostinfo = geth 阅读全文

posted @ 2013-02-26 11:00 小彭屋 阅读(541) 评论(0) 推荐(0)