Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect the IP addresses of other devices on the local network?

I already detect local IP address of my computer using this code (use sockets):

Function Ip_Local : String;
  Var Acces_Sock : TCustomIpClient;
Begin
  Acces_Sock := TCustomIpClient.Create(Nil);
  Try
    Result := Acces_Sock.LocalHostAddr
  Finally
    Acces_Sock.Free;
  End;
End; 

What about detecting the internal LAN IP address of the router and, if possible, of any LAN-connected appliance such as a DVR?

like image 308
volvox Avatar asked Jun 02 '11 03:06

volvox


People also ask

How can I see all devices on my local network?

For Windows Users: Type CMD in the search box and click Run as Administrator from the menu. Enter the net view command to view devices connected to your network You will then see a list of devices connected to your network in the output.

How can I see all IP addresses on my network in CMD?

From the desktop, navigate through; Start > Run> type "cmd.exe". A command prompt window will appear. At the prompt, type "ipconfig /all". All IP information for all network adapters in use by Windows will be displayed.


1 Answers

Using Indy:

function CsiGetRemoteIpAddress(const pHostName: string): string;
begin
  TIdStack.IncUsage;
  try
    Result := GStack.ResolveHost(pHostName);
  finally
    TIdStack.DecUsage;
  end;
end;
like image 56
Misha Avatar answered Oct 06 '22 00:10

Misha