如何用Java獲得一個域名的IP地址呢?提供這個功能的類叫做
import
import
public class NsLookup {
static public void main(String[] args) {
try {
InetAddress address = InetAddress
System
:
}
catch(UnknownHostException uhe) {
System
}
}
}
InetAddress也可以通過使用getAddress()來獲得IP地址
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19549.html