码迷,mamicode.com
首页 > 其他好文 > 详细

(temp)catch ip

时间:2016-07-14 13:20:15      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

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);

 

(temp)catch ip

标签:

原文地址:http://www.cnblogs.com/xzxdm/p/5669952.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!