public static long IPString2Number(String sip) {
		long nip = 0;
		String[] asip = sip.split("\\.");
		if (asip.length == 4) {
			for (int i = 0; i < 4; i++) {
				try {
					int val = Integer.parseInt(asip[i].trim());
					if (val >= 0 && val <= 255) {
						nip = (nip << 8) + val;
					} else
						return -1;
				} catch (NumberFormatException e) {
					return -1;
				}
			}
		} else
			return -1;
		return nip;
	}