CString sIPAddress;
struct hostent FAR *lpHostEnt=gethostbyname(" www.yahoo.com");
if(lpHostEnt == NULL)
{
sIPAddress = _T("");
}
LPSTR lpaddr = lpHostEnt->h_addr_list[0];
if(lpaddr)
{
struct in_addr inAddr;
memmove (&inAddr,lpaddr, 4);
sIPAddress=inet_ntoa (inAddr);
if(sIPAddress.IsEmpty())
sIPAddress=_T("Not available");
}
AfxMessageBox(sIPAddress);
struct hostent FAR *lpHostEnt=gethostbyname(" www.yahoo.com");
if(lpHostEnt == NULL)
{
sIPAddress = _T("");
}
LPSTR lpaddr = lpHostEnt->h_addr_list[0];
if(lpaddr)
{
struct in_addr inAddr;
memmove (&inAddr,lpaddr, 4);
sIPAddress=inet_ntoa (inAddr);
if(sIPAddress.IsEmpty())
sIPAddress=_T("Not available");
}
AfxMessageBox(sIPAddress);