rt

解决方案 »

  1.   

    int CGetIPDlg::GetIPAddress(const CString& sHostName, CString& sIPAddress)
    {
    struct hostent FAR *lpHostEnt = gethostbyname (sHostName);if (lpHostEnt == NULL) {
    // An error occurred. 
    sIPAddress = _T("");
    return WSAGetLastError();
    }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");
    } return 0;
    }
    也可以看看
    http://www.vckbase.com/bbs/prime/viewprime.asp?id=158
      

  2.   

    gethostbyaddr
    gethostbyname
    剩下的看帮助
      

  3.   

    to:xlandersorry........
    u r late...:)
    but thank u 2.