Skip to Content
avatar image
Former Member

how to capture ip address in portal for a particular app

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Dec 16, 2016 at 10:32 AM

    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

    Add comment
    10|10000 characters needed characters exceeded