使用idTCpServer和IdTCPClient,当一个客户端连上来时,怎样知道它的ip地址?

解决方案 »

  1.   

    查一下帮助,diTCPServer好像有个属性是去客户端ip的
      

  2.   

    procedure TForm1.IdTCPServer1Connect(AThread: TIdPeerThread);
    var
        ip:string;        
    begin
          
        ip :=   AThread.Connection.Binding.PeerIP;
     end;
      

  3.   

    to cqzy
    ip :=   AThread.Connection.Binding.PeerIP;这个方法有indy 9.0.3不行。没有binding这个成员的。
      

  4.   

    IdTCPServer1Execute事件中获得
    ip:=AThread.Connection.Socket.Binding.PeerIP
      

  5.   

    来晚了。^_^
    IdTCPServer1Execute事件中获得
    ip:=AThread.Connection.Socket.Binding.PeerIP
      

  6.   

    从IdTCPServer1Execute事件中获得
    ip:=AThread.Connection.Socket.Binding.PeerIP
    http://www.513soft.net:83/qlj/trans.rar