您的位置:首页 > 其它

InetAddress 获得Ip地址

2013-05-22 14:59 176 查看
package com.net.luzhiming;

import java.net.InetAddress;

public class InetAddressTest1 {

public static void main(String[] args) throws Exception {
System.out.println(InetAddress.getLocalHost());
System.out.println(InetAddress.getByName("www.baidu.com"));

}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: