11.1. Obtain Information About the Local Network Interface

Problem

You need to obtain information about the network adapters and network configuration of the local machine.

Solution

Call the Shared method GetAllNetworkInterfaces of the System.Net.NetworkInformation.NetworkInterface class to get an array of objects derived from the abstract class NetworkInterface. Each object represents a network interface available on the local machine. Use the members of each NetworkInterface object to retrieve configuration information and network statistics for that interface.

How It Works

The System.Net.NetworkInformation namespace, which was first introduced in .NET Framework 2.0, provides easy access to information about network configuration and statistics ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.