| View previous topic :: View next topic |
| Author |
Message |
paolol Guest
|
Posted: Thu Sep 15, 2005 12:34 pm Post subject: help on get the ip |
|
|
Hi any one know how I can get all the IP number from a PC ??
Thanks,
Paolol.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Sep 16, 2005 2:37 am Post subject: Re: help on get the ip |
|
|
"paolol" <paolol (AT) _nospam_salsan (DOT) net> wrote
| Quote: | Hi any one know how I can get all the IP number from a PC ??
|
Assuming you are using WinSock directly, then look at gethostname() and
gethostbyname(). gethostbyname() will return all of the available IP
addresses.
Gambit
|
|
| Back to top |
|
 |
paolol Guest
|
Posted: Fri Sep 16, 2005 9:41 am Post subject: Re: help on get the ip |
|
|
Remy Lebeau (TeamB) ha scritto:
| Quote: | "paolol" <paolol (AT) _nospam_salsan (DOT) net> wrote in message
news:43296a08 (AT) newsgroups (DOT) borland.com...
Hi any one know how I can get all the IP number from a PC ??
Assuming you are using WinSock directly, then look at gethostname() and
gethostbyname(). gethostbyname() will return all of the available IP
addresses.
Gambit
Thanks Gambit, |
but I'm still lost
I create the socket
Socket:=TCustomWinSocket.Create(1);
But then I don't see the method you mention.
Can you please explain a bit more how to do ?
Thanks a lot.
Paolol
|
|
| Back to top |
|
 |
Francois Piette [ICS & Mi Guest
|
Posted: Fri Sep 16, 2005 11:41 am Post subject: Re: help on get the ip |
|
|
| Quote: | Hi any one know how I can get all the IP number from a PC ??
|
Easy !
Start a new project, add WSocket to the uses clause.
Drop a TMemo on the form.
Drop a TButton on the form
Add this event handler:
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines := WSocket.LocalIPList;
end;
Compile, run, click on the button.
That's it.
BTW: WSocket unit is part of ICS. Download freeware and full source code
from http://www.overbyte.be
--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[email]francois.piette (AT) overbyte (DOT) be[/email]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be
|
|
| Back to top |
|
 |
paolol Guest
|
Posted: Fri Sep 16, 2005 2:11 pm Post subject: Re: help on get the ip |
|
|
Francois Piette [ICS & Midware] ha scritto:
| Quote: | Hi any one know how I can get all the IP number from a PC ??
Easy !
Start a new project, add WSocket to the uses clause.
Drop a TMemo on the form.
Drop a TButton on the form
Add this event handler:
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines := WSocket.LocalIPList;
end;
Compile, run, click on the button.
That's it.
BTW: WSocket unit is part of ICS. Download freeware and full source code
from http://www.overbyte.be
--
Contribute to the SSL Effort. Visit
http://www.overbyte.be/eng/ssl.html
--
[email]francois.piette (AT) overbyte (DOT) be[/email]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be
Thanks Francois, |
nice to see you here
That was easy :)
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Sep 19, 2005 7:53 am Post subject: Re: help on get the ip |
|
|
"paolol" <paolol (AT) _nospam_salsan (DOT) net> wrote
| Quote: | I create the socket
Socket:=TCustomWinSocket.Create(1);
But then I don't see the method you mention.
|
As per my earlier message:
"Assuming you are using WinSock directly"
Obviously, you are not using the WinSock API directly, so what I described
to you does not apply to TCustomWinSocket.
| Quote: | Can you please explain a bit more how to do ?
|
The native VCL has no provisions for what you are asking for. You need to
access the WinSock API directly. Or else use a different component library
that implements what you are looking for. Indy (http://www.indyproject.org)
and ICS (http://www.overbyte.be) both have means of querying the list you
are seeking (amongst doing many other things).
Gambit
|
|
| Back to top |
|
 |
|