开发者

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

开发者 https://www.devze.com 2023-03-10 07:14 出处:网络
I already detect local IP address of my computer开发者_运维知识库 using this code (use sockets):

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?


Using Indy:

function CsiGetRemoteIpAddress(const pHostName: string): string;
begin
  TIdStack.IncUsage;
  try
    Result := GStack.ResolveHost(pHostName);
  finally
    TIdStack.DecUsage;
  end;
end;
0

精彩评论

暂无评论...
验证码 换一张
取 消