//Program to find the ip address of a given machine name.
import java.net.*;
class IPFinder
{
public static void main(String args[])
{
try
{
InetAddress add = InetAddress.getByName(args[0]);
System.out.println("Ipaddress of Machine is "+add.getHostAddress());
}
catch(Exception e)
{
System.out.println(e);
}
}
}
Use your Computer Name at the place of localhost to get your ip address.
0 Comments:
Post a Comment