[Network] How to get Internet IP

Discussion in 'Java' started by Alexandre Jaquet, Oct 31, 2003.

  1. Hi

    I need to find how to get he's own internet ip.

    Not the local ip.

    Thanks in advance.
     
    Alexandre Jaquet, Oct 31, 2003
    #1
    1. Advertising

  2. In article <3fa27022$0$3676$>, Alexandre Jaquet wrote:
    > Hi
    >
    > I need to find how to get he's own internet ip.
    >
    > Not the local ip.

    In java you cannot. Probably if you know what system/os you're on, you
    could execute some external program and parse the output, but not
    (easily) otherwise.
     
    Nils O. =?iso-8859-1?Q?Sel=E5sdal?=, Oct 31, 2003
    #2
    1. Advertising

  3. Alexandre Jaquet

    Anton Spaans Guest

    Use this call

    InetAddress ipAddr = InetAddress.getLocalHost();
    String numericIP = ipAddr.getHostAddress();

    It'll work if your TCP/IP properties are configured ok.

    -- Anton.


    "Alexandre Jaquet" <> wrote in message
    news:3fa27022$0$3676$...
    > Hi
    >
    > I need to find how to get he's own internet ip.
    >
    > Not the local ip.
    >
    > Thanks in advance.
    >
    >
     
    Anton Spaans, Oct 31, 2003
    #3
  4. Alexandre Jaquet

    Roedy Green Guest

    Roedy Green, Oct 31, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    2,794
    parwejp
    Nov 19, 2007
  2. cmay
    Replies:
    0
    Views:
    1,172
  3. Replies:
    7
    Views:
    6,831
    Alex Molochnikov
    Feb 23, 2005
  4. Replies:
    2
    Views:
    437
    Juhan Kundla
    Feb 22, 2005
  5. John Smith
    Replies:
    1
    Views:
    167
    Evertjan.
    Mar 12, 2005
Loading...

Share This Page