Using the NetworkInterface class
NetworkInterface class provides a means of accessing the devices that act as nodes on a network. This class also provides a means to get low-level device addresses. Many systems are connected to multiple networks at the same time. These may be wired, such as a network card, or wireless, such as for a wireless LAN or Bluetooth connection.
NetworkInterface class represents an IP address and provides information about this IP address. A
network interface is the point of connection between a computer and a network. This frequently uses an NIC of some type. It does not have to have a physical manifestation, but it can be performed in software as done with the loopback connection (
127.0.0.1 for IPv4 and