Article View: borland.public.cppbuilder.internet.web
Article #646Re: how do you find out what your ip address is?
From: Remy Lebeau (TeamB)
Date: Thu, 20 Jul 2006 20:34
Date: Thu, 20 Jul 2006 20:34
25 lines
1910 bytes
1910 bytes
"alan" <alan@overthere.com> wrote in message news:44bfe452$1@newsgroups.borland.com... > There must be a function out in builder that will tell > you what your computer ip address is. There is nothing in Builder itself for that. You have to go to the Win32 API for it. You have two choices: 1) gethostname() and gethostbyname(). Look in the h_addr_list member of the hostent structure that gethostbyname() returns. 2) GetAdaptersInfo(). Look at the IpAddressList member of the IP_ADAPTER_INFO structure that it returns. Note, however, that these can only return the IP address(es) that are assigned directly to the machine. If your machine is on a network, and the Internet address is assigned to a router or to another machine that has Internet Connection Sharing enabled, then you will not be able to obtain the Internet IP address directly. You will have to query an external server, such as by sending an HTTP request to http://iplookup.flashfxp.com. Gambit
Technical Details
Message-ID:
<44bfe95c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!newsfeed.kamp.net!newsfeed.kamp.net!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44bfe452$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,58b967d5f8196616 X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.web References: <44bfe452$1@newsgroups.borland.com> Subject: Re: how do you find out what your ip address is? Date: Thu, 20 Jul 2006 13:34:53 -0700 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <44bfe95c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1153427804 68.69.17.41 (20 Jul 2006 13:36:44 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!newsfeed.kamp.net!newsfeed.kamp.net!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail