Alaska Software Inc. - IPAdr
Username: Password:
AuthorTopic: IPAdr
Werner StuehrenbergIPAdr
on Mon, 08 Aug 2005 13:13:35 +0200
I use Phils program IPAdr executing socketgethostbyname('localhost')
and get the machine ip in my  local network.
Could anybody show me how I can get the IP-Adress my computer  has now  in 
the Internet ?
Werner
Pablo BotellaRe: IPAdr
on Mon, 08 Aug 2005 13:26:14 +0200
Hi,
> Could anybody show me how I can get the IP-Adress my computer  has now  in 
> the Internet ?
You can use my free library that gives you access to the the same info as 
IPCONFIG and
NETSTAT commands.


http://www.xbwin.com/download/IPCfg.zip

_aGetAdapterInfo(lDns,lAlias) -> {oIPAdapterInfo, ... }
_aGetTcpTable( lSort) -> { oMibTcpRow, ... }
_aGetUdpTable( lSort) -> { oMibTcpRow, ... }

Regards,
Pablo Botella
Thomas Braun Re: IPAdr
on Mon, 08 Aug 2005 14:01:23 +0200
Pablo Botella wrote:

> You can use my free library that gives you access to the the same info as 
> IPCONFIG and NETSTAT commands.

Will this work as well if the computer ist behind a NAT gateway?

Thomas
Pablo BotellaRe: IPAdr
on Mon, 08 Aug 2005 16:38:47 +0200
Thomas,
> Will this work as well if the computer ist behind a NAT gateway?

No, I was written this functions just a replacement of my previous aproach 
that was run IPCONFIG and NETSTAT redirected to a text file and then parse 
the results. This functions give me more consitent results and be aware of 
diferent win versions and regional settings.

_aGetAdapterInfo() that can be the equivalent of IPCONFIG uses 
GetAdaptersInfo() and GetPerAdapterInfo() and the corresponding registry 
values to get the adapter alias. _aGetTcpTable() and aGetUdpTable() that 
will be the equivalent of NETSTAT /a  uses GetTcpTable() and GetUdpTable()

Probably you will need to playing a bit with GetIpForwardTable() and related 
functions, would be nice if you can let me know your results.
Regards,
Pablo
Werner StuehrenbergRe: IPAdr
on Mon, 08 Aug 2005 14:57:39 +0200
Dear Pablo, dear Thomas,

Pablos program works great, certainly it shows me all the information as 
ipconfig or netstat would provide. Of course, the program is very complex 
and not easy to follow for me. In reality I look for a short solution just 
showing my current IP-Address I have during an active internet session using 
asinet like Phil already did for the local machine ip. My purpose is that 
the user of my xbase-program can tell me his current internet-IP which I 
could use for a remote process.

Werner

"Pablo Botella" <np@pablob.com> schrieb im Newsbeitrag 
news:ZdvlSwAnFHA.3104@S15147418...
> Hi,
>> Could anybody show me how I can get the IP-Adress my computer  has now 
>> in the Internet ?
> You can use my free library that gives you access to the the same info as 
> IPCONFIG and
> NETSTAT commands.
>
>
> http://www.xbwin.com/download/IPCfg.zip
>
> _aGetAdapterInfo(lDns,lAlias) -> {oIPAdapterInfo, ... }
> _aGetTcpTable( lSort) -> { oMibTcpRow, ... }
> _aGetUdpTable( lSort) -> { oMibTcpRow, ... }
>
> Regards,
> Pablo Botella
>
>
>
>
Pablo BotellaRe: IPAdr
on Mon, 08 Aug 2005 17:26:26 +0200
Werner,

>the program is very complex and not easy to follow for me.

_aGetAdapterInfo(lDns,lAlias) gives an array of tIPAdapterInfo objects, one 
per network card ( Dialup is also consider a network card) .
Probably in the most cases you will only need  oAdapter:aIPList  ( note that 
one adapter can have more that a single IP address) and just discard the 
rest of the info.

Unfortunatelly get the internet address sometimes can be more hard that 
seems at the first look. From the inside sometimes you can get only the 
private IP and from external server sometimes you will get only the proxy 
IP.

Regards
Guenter Beyes Re: IPAdr
on Mon, 08 Aug 2005 15:09:10 +0200
Werner,

> Could anybody show me how I can get the IP-Adress my computer  has now  in 
> the Internet ?

Access an external service, such as http://www.whatsmyip.info/ or
http://www.whatsmyip.de/, which is set up to return your current IP
address.  

Just load that url's HTML source, for example using Phil's LoadFromUrl
function, and extract the required information..


Regards,
Günter
Phil Ide
Re: IPAdr
on Mon, 08 Aug 2005 14:52:05 +0100
Werner,

> I use Phils program IPAdr executing socketgethostbyname('localhost')

...that's Anand's code...

Someone posted to these NG's some source to return ALL ip addresses
established on each card.

Regards,

Phil Ide

*******************************************
*   Xbase++ FAQ, Libraries and Sources:   *
*   goto: http://www.idep.org.uk/xbase    *
* --------------------------------------- *
* www.xodc.org.uk - openSource Dev-Center *
*******************************************

You need the MANUALS to use this tagline!
Greg Doran Re: IPAdr
on Mon, 08 Aug 2005 16:57:59 +0100
Maybe this will be of use to you.

http://betteripaddress.com/

Regards
Greg Doran, Dublin Ireland.
Werner StuehrenbergRe: IPAdr
on Tue, 09 Aug 2005 14:30:38 +0200
Thank you very much for your help !
The program Pablo offered me to download was very detailed. For my purpose 
the simple solution was sufficient enough  receiving the internet ip-address 
vial loadfromurl. I found another internet page offering only the ip-adress 
so no extract is necessary, that is:
http://www.ipadresse.net/ip.php
Best regards,
Werner

"Greg Doran" <gdo@eircom.net> schrieb im Newsbeitrag 
news:AL$t8HDnFHA.2944@S15147418...
> Maybe this will be of use to you.
>
> http://betteripaddress.com/
>
> Regards
> Greg Doran, Dublin Ireland.