#i nclude "winsock.h"      WORD wVersionRequested;
      WSADATA wsaData;
      char name[255];
      CString ip;
      PHOSTENT hostinfo;
      wVersionRequested = MAKEWORD( 2, 0 );      if ( WSAStartup( wVersionRequested, &wsaData ) == 0 )
      {            if( gethostname ( name, sizeof(name)) == 0)
            {
                  if((hostinfo = gethostbyname(name)) != NULL)
                  {
                        ip = inet_ntoa (*(struct in_addr *)*hostinfo->h_addr_list);
                  }
            }
            
            WSACleanup( );
      }
   AfxMessageBox(ip);
====================================================================================
上面这个是别人写的一个获取本机IP地址的代码,在没有使用代理线路(比如VPN)上网的情况下获取的IP是正确的,但代理上网的情况下就获取不到正确的IP了,请问怎样才能在不使用代理和使用代理的情况下都能得到正确IP?