//把CString表示的IP地址写到IP Address里面
CString strIP="192.168.0.17";
DWORD dwIP=ntohl(inet_addr(strIP));
m_IP.SetAddress(dwIP);
//读取IP Address的内容.
DWORD dwIP;
IN_ADDR ia;
CString strIP;
m_IP.GetAddress(dwIP);
ia.S_un.S_addr=htonl(dwIP);
strIP=inet_ntoa(ia);
本篇文章来源于:开发学院 http://edu.codepub.com 原文链接:http://edu.codepub.com/2009/0616/6405.php