Possible Duplicate:
Getting the 'external' IP address in Java
i'm using JAVA for a write a simple messenger, but i need know the IP address of the machine where is running my program
Thanks.
Possible Duplicate:
Getting the 'external' IP address in Java
i'm using JAVA for a write a simple messenger, but i need know the IP address of the machine where is running my program
Thanks.
You can either parse a "what is my IP" website (like http://my-i-p.com/), which usually restrict the frequency you can get the IP.
Or, if you have your own web server, you can have the application contact a PHP page, for example, that prints the IP address on the page. Download that page to retrieve the IP address from the text.