/**
* dns域名解析函数
* @param address
* @return
*/
public String DnsAnalyze(String address){
InetAddress inetAdd = null;
String ip_devdiv = "";
try {
inetAdd = InetAddress.getByName(address);
ip_devdiv = inetAdd.getHostAddress();//得到字符串形式的ip地址
Log.d("zfr_ip===", "IP地址为:"+ip_devdiv);
} catch (UnknownHostException e) {
e.printStackTrace();
}
return ip_devdiv;
}
注:如有问题可以回复,看到第一时间分析解决,码农不易,感觉对您有用,帮助到您,可否打赏一杯可乐,在此谢过诸位,愿诸君终成大神,前程似锦~~~