查询IP归属地

//查询ip归属地
String ip = "139.196.234.61";
URL url = new URL("http://www.36ip.cn/?ip=" + ip);
BufferedReader r = new BufferedReader(new InputStreamReader(url.openConnection().getInputStream(),"UTF-8"));
System.out.println(r.readLine().split(" ")[0]);

 

posted @ 2022-06-08 14:28  嚼_嚼_籽  阅读(212)  评论(0编辑  收藏  举报