Board index » delphi » Re: Dual cards/IP: TIdIPWatch

Re: Dual cards/IP: TIdIPWatch


2003-09-11 12:40:35 AM
delphi233
"Jonas Gunnarsson" <XXXX@XXXXX.COM>writes
Quote
I would like a stringlist with all IP-addresses for the machine.
TIdStack has a LocalAddresses property which contains all of the available
IP addresses. Call it via the global GStack pointer:
GStack.LocalAddresses
Gambit
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03
 
 

Re: Dual cards/IP: TIdIPWatch

Thanks!
uses
IdStack;
procedure TForm1.ReadLocalAddresses;
begin
ComboBox1.Clear;
ComboBox1.Items.Assign(GStack.LocalAddresses);
end;
/Jonas
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>skrev i meddelandet
Quote

"Jonas Gunnarsson" <XXXX@XXXXX.COM>writes
news:3f5ee9b2$XXXX@XXXXX.COM...

>I would like a stringlist with all IP-addresses for the machine.

TIdStack has a LocalAddresses property which contains all of the available
IP addresses. Call it via the global GStack pointer:

GStack.LocalAddresses


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03


 

Re: Dual cards/IP: TIdIPWatch

You must ensure that you have at least one Indy component instantiated, otherwise Gambit's code will crash.
Regards,
AndrewFG
---
// use a dummy indy component get the local host details
lComp := TIdComponent.Create(nil);
try
fComputerName := lComp.LocalName;
fIPAddress := GStack.LocalAddress;
finally
lComp.Free;
end;
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes news:3f5f53de$XXXX@XXXXX.COM...
Quote

"Jonas Gunnarsson" <XXXX@XXXXX.COM>writes
news:3f5ee9b2$XXXX@XXXXX.COM...

>I would like a stringlist with all IP-addresses for the machine.

TIdStack has a LocalAddresses property which contains all of the available
IP addresses. Call it via the global GStack pointer:

GStack.LocalAddresses


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03