JAVA获取本地的IP地址方法
import java.net.InetAddress;try{InetAddress test=InetAddress.getLocalHost();System.out.println(test.getHostAddress());}catch(UnknownHostException e){e.printStackTrace();}