标签:
String str = "192.168.1.100"; String[] ipStr = str.split("\\."); byte[] ipBuf = new byte[4]; for(int i = 0; i < 4; i++){ ipBuf[i] = (byte)(Integer.parseInt(ipStr[i])&0xff); } try{ InetAddress ia = InetAddress.getByAddress("Server",ipBuf);
标签:
原文地址:http://www.cnblogs.com/xzxdm/p/5669952.html