开发者

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?


Using Indy:

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜