package test;

import java.io.IOException;
import java.net.InetAddress;

public class Test {  
	  
    public static void main(String[] args) throws IOException {
    	String url="www.baidu.com";//不知为什么加上http://报错
    	InetAddress address=InetAddress.getByName(url);
    	System.out.println("baidu的IP地址:" + address.getHostAddress()) ;
    }
    
   
    /**
     *baidu的IP地址:119.75.217.109
		
     */
}


相关文章:

  • 2021-04-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-08-19
  • 2022-12-23
  • 2022-01-15
猜你喜欢
  • 2021-11-22
  • 2022-03-09
  • 2021-06-09
  • 2022-03-06
  • 2022-12-23
  • 2021-08-29
相关资源
相似解决方案