Board index » delphi » List of local network adapters and IP address

List of local network adapters and IP address

I've been through a fair swag of messages on the newsgroup and found plenty
to tell me how to get the list of IP addresses for a computer, but none to
tell me how to get a list of network adapters and then the IP address for
each respective adapter.  Actually, when I say adapter, I'm really talking
about a network or dial-up connection, as some of the adapters are virtual.
The scenario is that I'm writing a little app for a few mates so that we can
connect to each other's machines over the Internet by sending our hostname
and (constantly changing) IP address for a particular adapter to a webserver
and then download the IP address of the others - which we then use to update
the local hosts file.

Can anyone help?  At the moment, I'm thinking of just invoking "IPCONFIG"
and parsing it's output, which is a bit of a hack.

Cheers,
Scott Barden

 

Re:List of local network adapters and IP address


On my machine, where the shared modem is behind a router, IPCONFIG
cannot determine its dynamic WAN address. If anyone knows how to
do it maybe using SNMP or the new IPHELP api, please let me know.

Alternatively, if you are running a web server, Patrick Schmidt has
a freeware app + php script to do just that. The app is in german
but the author is very helpful.
http://www.step-gmbh.de

Hope it helps,

Jacques

Quote
Scott Barden wrote:

> I've been through a fair swag of messages on the newsgroup and found plenty
> to tell me how to get the list of IP addresses for a computer, but none to
> tell me how to get a list of network adapters and then the IP address for
> each respective adapter.  Actually, when I say adapter, I'm really talking
> about a network or dial-up connection, as some of the adapters are virtual.

> The scenario is that I'm writing a little app for a few mates so that we can
> connect to each other's machines over the Internet by sending our hostname
> and (constantly changing) IP address for a particular adapter to a webserver
> and then download the IP address of the others - which we then use to update
> the local hosts file.

> Can anyone help?  At the moment, I'm thinking of just invoking "IPCONFIG"
> and parsing it's output, which is a bit of a hack.

> Cheers,
> Scott Barden

Re:List of local network adapters and IP address


Quote
"Scott Barden" <sbar...@basistechnologies.com> wrote in message

news:95u463$eeu1@bornews.inprise.com...
Quote
> I've been through a fair swag of messages on the newsgroup and found
plenty
> to tell me how to get the list of IP addresses for a computer, but none to
> tell me how to get a list of network adapters and then the IP address for
> each respective adapter.  Actually, when I say adapter, I'm really talking
> about a network or dial-up connection, as some of the adapters are

virtual.
See GetIpAddrTable from IpHlpApi. Headers are available on Delphi-Jedi. This
function works only on Win98, WinNT 4.0 (SP4 and higher) and W2K.

--
Best Regards,
Vladimir Vassiliev
http://voldemarv.virtualave.net

Other Threads