Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.3k views
in Java FTP by (120 points)
i m using the ftp server ... i want to kwow how can i get the ip address of the client ...
thaks in advance
joseph thomas

1 Answer

0 votes
by (162k points)
From within your code that is running on the client?

InetAddress.getByName("hostname").getHostAddress();

will get any host's IP address

or

InetAddress.getLocalHost().getHostAddress();

will give you the local host's IP address (loopback IP).

both give a string representation of the IP address

Categories

...