Getting local IP addresses lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Prime · 2023-03-13 09:32 Hi all, I'm porting some code from Delphi 7 to Lazarus, on Delphi I use one for the Jv components, TJvComputerInfoEx, to get the local IP address e.g. the one assigned to the network card (or other link) in the machine. Is there a (hopefully cross platform) way of doing this under Lazarus / FPC. Even separate methodsfor platforms might be OK as I can make a wrapper that presents them to the client code in a platform independent way. Cheers. Phill. ---------------------------------------------------------------------- six1 · 2023-03-13 09:56 You can try this Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var   txt:string;begin{$IFDEF Linux}  RunCommand('ip', ['a'], txt);{$ELSEIF Windows}  RunCommand('ipconfig', [''], txt);{$ENDIF} showmessage (txt);end;                   and parse the output for your needs ---------------------------------------------------------------------- Warfley · 2023-03-13 10:39 The ip utils might not be installed on Linux. To get the IP address without external tools you can simply read the pseudofiles in /proc/net: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ➜ cat /proc/net/if_inet6fe80000000000000021...095 06 40 20 80     eth000000000000000000000000000000001 01 80 10 80       loThis file contains all the ipv6 interaces, eth0 with the IPv6 address fe80::21...095 (redacted for privacy reasons) and the loopback with ::1