Skip to Content
0

how to capture ip address in portal for a particular app

Dec 14, 2016 at 10:31 AM

28

avatar image

Hi I have the similar requirement to capture the IP Address of clients while running a particular application from portal. Can anyone please help me in capturing this requirement.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Kamal j Dec 16, 2016 at 10:32 AM
0

Hi Santosh,

If you are trying to capture the IP Address in a java based application, below code will be helpful. Highlighted String will have the user's system IP address.

import java.net.InetAddress;

import java.net.UnknownHostException;

try {

InetAddress ipAddr = InetAddress.getLocalHost();

String IP = ipAddr.getHostAddress();

} catch (UnknownHostException ex)

{ ex.printStackTrace(); }

Regards,

Kamal

Share
10 |10000 characters needed characters left characters exceeded