import java.net.*;

class InetAddressTest
{
 public static void main(String args[])
 {
  try
  {
   InetAddress add=InetAddress.getLocalHost();
   System.out.println("本地主机的IP地址是:"+add);

  }
  catch (UnknownHostException u){}
  
 }
}

评论
发表评论

您还没有登录,请登录后发表评论