InetAddress
2021-06-09 04:14
标签:package oid public import add mod [] pop test
InetAddress 标签:package oid public import add mod [] pop test 原文地址:http://www.cnblogs.com/jhcelue/p/7304899.htmlpackage 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
*/
}
下一篇:关于C#的数据源的转化