public static String getIP() {
		String ipstr = null;
		try {
			Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();// 返回所有网络接口的一个枚举实例

			while (e.hasMoreElements()) {
				NetworkInterface network = e.nextElement();// 获得当前网络接口
				if (network != null && network.isUp()) {

					List<InterfaceAddress> en = network.getInterfaceAddresses();

					Iterator<InterfaceAddress> it = en.iterator();
					while (it.hasNext()) {
						InterfaceAddress inter = it.next();
						String ip = inter.getAddress().getHostAddress();
						if (!determineIpAddress(ip)) {
							System.out.println("--InetAddress " + ip);
							ipstr = ip;
							break;

						}

					}

					if (ipstr != null) {
						break;
					}

				}
			}
		} catch (SocketException e) {
			e.printStackTrace();
		}
		return ipstr;
	}