This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, is there a way to obtain an IP address of the current box through using Java? I am creating an installation package and require the user type in their IP address. I would like the default adr in the box to be the IP of the current machine. Thanks in advance.
Bear in mind that the IP address is not an attribute of the computer, it's an attribute of the network adapter. So if a computer has two network adapters (it's quite common these days to have an adapter where you plug an Ethernet cable in as well as a wireless adapter), then it has two IP addresses.
Also bear in mind that the IP address can vary over time. When I'm at work my laptop is assigned an IP address by the office's server, and when I take the laptop home, it's assigned a different IP address by my ISP's server. [ August 15, 2006: Message edited by: Paul Clapham ]
I'm guessing that by "external IP address" you mean the IP address of the router or proxy server through which you are connected to the Internet. If you wanted, you could make an HTTP connection to http://whatismyipaddress.com/ and parse it out of the page you get back. At any rate, go to that page and read the FAQs. See if any of them help you.