摘要:
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_... 阅读全文