static InetAddress getLocalHost()             Returns the local host. 非是Stringjava.lang.Object
  |
  +-java.net.InetAddress不过Object有toString(),自己试试吧,static的意义我也不是很懂

解决方案 »

  1.   

    InetAddress.getLocalHost().getHostAddress();
      

  2.   

    将你的"message=InetAddress.getLocalHost();"
    改成"message=InetAddress.getLocalHost().boString();"就行了。
      楼上说得对,每个Object 都有toString()函数。
      

  3.   

    InetAddress localNode;
    localNode = InetAddress.getLocalHost();
    String localIP = localNode.getHostAddress();
      

  4.   

    如果用InetAddress.getLocalHost().toString()得到的是“机器名/IP”。
    用InetAddress.getLocalHost().getHostAddress()得到的是“IP”。
      

  5.   

    这样就可以了啊message=InetAddress.getLocalHost().toString();
      

  6.   

    InetAddress.getLocalHost()得到的是InetAddress类型;转换成字符串:InetAddress.getLocalHost().toString();