通过socket连接,自己找找文档,方法都有的,^_^

解决方案 »

  1.   

    import java.net.*; 
    class dg
    {
      public static void main(String[] args) throws Exception
      {
         System.out.println(InetAddress.getLocalHost());
         System.out.println(InetAddress.getByName("127.0.0.1"));
         System.out.println(InetAddress.getByName("127.0.0.1"));
      }
    }
      

  2.   

    试试 kkcncry(大连轻工业学院!大四!王某) 的吧!
      

  3.   

    我以前还真不知道有这个类InetAddress 又学一招