[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: Finding (dynamic/static/whatever) current IP address ?
The rpogram which is attached displays the IP of the host given on command
line. Replace getByName() with getLocalHost() to get the IP of the
On Mon, Dec 25, 2000 at 09:30:31AM -0800, shantanu_gwl@xxxxxxxxxxxx wrote:
>Can anyone please guide as how to find the current IP address of my machine programmatically, like WINIPCFG in Win98 ? Any straight-forward way to code this in Java ?
>Any pointer will be of immense help. Thanks in advance.
Anand Biligiri S
Absence makes the heart forget.
public static void main(String args)
host = InetAddress.getByName(args);
System.out.println("Invalid Host/Host not reacheable:" + args);