Documentation

The Java™ Tutorials
Hide TOC
Programmatic Access to Network Parameters对网络参数的编程访问
Trail: Custom Networking

Lesson: Programmatic Access to Network Parameters课程:对网络参数的编程访问

Systems often run with multiple active network connections, such as wired Ethernet, 802.11 b/g (wireless), and bluetooth. 系统通常使用多个活动网络连接运行,例如有线以太网、802.11 b/g(无线)和蓝牙。Some applications might need to access this information to perform the particular network activity on a specific connection.某些应用程序可能需要访问这些信息,才能在特定连接上执行特定的网络活动。

The java.net.NetworkInterface class provides access to this information.java.net.NetworkInterface类提供对这些信息的访问。

This lesson guides you through some of the more common uses of this class and provides examples that list all the network interfaces on a machine as well as their IP addresses and status.本课程将指导您了解此类的一些更常见的用法,并提供示例,列出机器上的所有网络接口及其IP地址和状态。

What Is a Network Interface?什么是网络接口?

This page describes a network interface and explains why you might want to use it.本页描述了一个网络接口,并解释了您可能想要使用它的原因。

Retrieving Network Interfaces检索网络接口

This page contains an example that illustrates how a client program can retrieve all the network interfaces on a machine.本页包含一个示例,说明客户端程序如何检索机器上的所有网络接口。

Listing Network Interface Addresses列出网络接口地址

This page shows you how to list the IP addresses assigned to all the network interfaces on a machine.本页显示如何列出分配给机器上所有网络接口的IP地址。

Network Interface Parameters网络接口参数

This page shows you how to determine whether a network interface is running or if the network interface is a loopback interface, a point-to-point interface, or a virtual interface. 此页面显示如何确定网络接口是否正在运行,或者网络接口是环回接口、点对点接口还是虚拟接口。You can also learn how to determine if the interface supports multicasting.您还可以了解如何确定接口是否支持多播。


Previous page: Previous Lesson
Next page: What Is a Network Interface?