标签:har ipa unsigned sign address set pip 主机信息 max
char szHostName[MAX_PATH + 1];
gethostname(szHostName, MAX_PATH); //得到计算机名
hostent *p = gethostbyname(szHostName); //从计算机名得到主机信息
char *pIP1 = inet_ntoa(*(in_addr *)p->h_addr_list[0]);//将32位IP转化为字符串IP
DWORD dwip = inet_addr(pIP1);
unsigned char *pIP = (unsigned char*)&dwip;
m_ipAddr.SetAddress(*pIP, *(pIP + 1), *(pIP + 2), *(pIP + 3));//控件变量设置IP地址
标签:har ipa unsigned sign address set pip 主机信息 max
原文地址:http://www.cnblogs.com/judes/p/6227461.html