ok here's small program to retrieve the ip from
http://checkip.dyndns.org/ and the source coded in c
wanip.c
CODE
#include <wininet.h>
#include <stdio.h>
#define AUTHOR "da_cash"
CHAR buffer[100];
int i=75;
int main()
{
printf("+-----------------------+\n");
printf("+ WAN IP by %s/2k5 +\n",AUTHOR);
printf("+-----------------------+\n\n");
HINTERNET hINet, hFile;
CHAR buffer[100];
hINet = InternetOpen(AUTHOR, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
if ( !hINet )
{
printf("Error getting WAN IP");
return;
}
hFile = InternetOpenUrl( hINet,"http://checkip.dyndns.org/" , NULL, 0, 0, 0 );
if ( hFile )
{
DWORD dwRead;
InternetReadFile( hFile, buffer, 100, &dwRead );
}
InternetCloseHandle( hFile );
InternetCloseHandle( hINet );
printf("WAN IP:");
while ((buffer[i] != 0x3C) && (i < sizeof(buffer)))
{
printf("%c",buffer[i]);
i++;
}
printf("\n");
return;
}
include wininet.lib
code may be unproffessional but it works..i'm still learning. binary version attached.