InetAddress类
来源:互联网 发布:java 发送短信接口 编辑:程序博客网 时间:2024/06/05 15:29
import java.net.InetAddress;import java.net.UnknownHostException;import java.util.Arrays;/* * InetAddress类 */public class Test01 {public static void main(String[] args) throws UnknownHostException {// 获取本机的InetAddress实例InetAddress address = InetAddress.getLocalHost();System.out.println("计算机名:" + address.getHostName());System.out.println("IP地址;" + address.getHostAddress());byte[] b = address.getAddress();System.out.println("字节数组形式的IP:" + Arrays.toString(b));System.out.println(address);// 可以根据IP地址和计算机名获取InetAddress实例InetAddress address2 = InetAddress.getByName("192.168.12.122");InetAddress address1 = InetAddress.getByName("WIN-TEUR41V3M54");}}
0 0
- InetAddress类
- InetAddress类
- InetAddress类 示例
- InetAddress类的使用
- InetAddress类详解
- Java InetAddress类
- InetAddress 类使用说明
- InetAddress类和InetSocketAddress
- InetAddress类的使用
- InetAddress 类简介
- 关于InetAddress类
- InetAddress类的使用
- JAVA网络-InetAddress类
- Java之InetAddress类
- 网络地址-InetAddress类
- JAVA:InetAddress类
- InetAddress(IP类)
- InetAddress(IP类)
- 响应式开发从原理到实战案例(八):使用bootstrap V3.3.7实现响应式页面
- Codeforce数据结构目录
- linux下解决文件乱码问题及查看文件编码方法
- python爬虫之爬百度美女图片
- newton插值法c++版
- InetAddress类
- CoreData在Swift 3.0中的一点改变
- NULL,0和'\0'辨析
- 算法-归并排序
- POJ 3650 The Seven Percent Solution G++
- VirtualBox中ubuntu的网络设置
- 五布局之相对布局RelativeLayout
- Python装饰器的用法
- git 分支合并