Article View: borland.public.cppbuilder.nativeapi
Article #11379Re: retrieve my IP Address.
From: Hans Galema
Date: Fri, 06 Feb 2004 21:39
Date: Fri, 06 Feb 2004 21:39
37 lines
2169 bytes
2169 bytes
Marcello Scala wrote: >>http://checkip.dyndns.org/ > > yes. > Whit this link, i read my Real IP... That is the IP your ISP gave you and on which address you are reacheble from anywhere on the internet. > if i use IPConfig, i read my Router IP. No, you get the IP of the adapters of your computer. Your router's IP is the internet IP. The last ones must be the same. > With my programs, how can get my Ip? > In My Windows, if i run IpConfig, i read the IP of my Router nut not the IP > Internet. No you read the IP of a specific adapter of your computer. Your computer is not aware of a router. > How can i read the "Real" ip like http://checkip.dyndns.org/ ? You continue calling that real IP? What you want is the IP your ISP gave you and which is the same as the IP of the router. You can use a HTTP component to query http://checkip.dyndns.org and then parse out the IPaddress from a very simple html page. You can also use gethostbyname() provided you know the hostname of the internetconnection your ISP gave you. Is your router between a modem and your computer ? Hans.
Technical Details
Message-ID:
<4024084b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4023de99@newsgroups.borland.com> <4023ec4a$1@newsgroups.borland.com> <4023f6a8$2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,f70891bebb04b30f X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-06 13:40:32 PST Date: Fri, 06 Feb 2004 22:39:07 +0100 From: Hans Galema <dontusethis@dontusethis.nl> User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: retrieve my IP Address. References: <4023de99@newsgroups.borland.com> <4023ec4a$1@newsgroups.borland.com> <4023f6a8$2@newsgroups.borland.com> In-Reply-To: <4023f6a8$2@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 129.125.108.11 Message-ID: <4024084b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1076103243 129.125.108.11 (6 Feb 2004 13:34:03 -0800) Lines: 37 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail