摘要: LPHOSTENT hostEntry = NULL; char hostName[BUFSIZE]; gethostname(hostName, BUFSIZE); hostEntry = gethostbyname(hostName); if (!hostEntry) { AfxMessageBox(_T("获取主机IP地址失败")); return FALSE; } // 设置sockaddr_in SOCKADDR_IN addrServ; addrServ.sin_addr = *((LPIN_... 阅读全文
posted @ 2013-08-21 10:10 BornThisWay 阅读(269) 评论(0) 推荐(0) 编辑