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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.