Client ip address

0 votes
asked Mar 5, 2011 by Mit (200 points)
edited Apr 4, 2011

I need to determine the address of the client (my PDA) when connecting to FTP server. Is it possible to obtain this information through Rebeh.FTP?

1 Answer

0 votes
answered Mar 7, 2011 by Lukas Matyska (39,520 points)
edited Mar 7, 2011
 
Best answer

It is possible to obtain the client IP address using the LocalEndPoint property after the client Ftp object is connected to the FTP server as follows:

using System.Net;
using Rebex.Net;

Ftp client = new Ftp();
client.Connect("serverName");
IPEndPoint lep = (IPEndPoint)client.LocalEndPoint;
IPAddress lip = lep.Address;
...