NetworkAdapter Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a network adapter and provides access to information about its capabilities, connection status, and network properties.
public ref class NetworkAdapter sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class NetworkAdapter final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class NetworkAdapter
Public NotInheritable Class NetworkAdapter
- Inheritance
- Attributes
Windows requirements
| Device family |
Windows 10 (introduced in 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Remarks
A NetworkAdapter instance is typically obtained from a ConnectionProfile through the NetworkAdapter property. You can use this object to access details about the physical or virtual network interface, including bandwidth capabilities, interface type, and associated network item information.
Key properties and methods
The NetworkAdapter class provides several important properties:
- OutboundMaxBitsPerSecond and InboundMaxBitsPerSecond: Maximum theoretical bandwidth capabilities.
- IanaInterfaceType: Standard interface type classification.
- NetworkAdapterId: Unique identifier for the adapter.
- NetworkItem: Associated network information.
Important
The bandwidth values returned by OutboundMaxBitsPerSecond and InboundMaxBitsPerSecond represent the maximum theoretical speeds of the network adapter hardware, not the actual available bandwidth on the current connection.
Getting connection profile information
Use GetConnectedProfileAsync to retrieve the ConnectionProfile associated with this network adapter. This is useful when you have a NetworkAdapter reference and need to access connection-specific information like cost, usage data, or connectivity status.
var adapter = connectionProfile.NetworkAdapter;
var profile = await adapter.GetConnectedProfileAsync();
// Use profile to access connection-specific information
Interface type classification
The IanaInterfaceType property returns a numeric value corresponding to IANA interface types. Common values include:
- 6: Ethernet
- 24: Loopback interface
- 71: IEEE 802.11 wireless LAN
- 243: WWAN (cellular/mobile broadband)
For a complete list, refer to the IANA Interface Types registry.
Properties
| IanaInterfaceType |
Gets the network interface type as defined by the Internet Assigned Numbers Authority (IANA) for the |
| InboundMaxBitsPerSecond |
Gets a value indicating the maximum inbound data transfer rate in bits per second. |
| NetworkAdapterId |
Gets the network adapter ID. |
| NetworkItem |
Gets the NetworkItem object that represents the connected network. |
| OutboundMaxBitsPerSecond |
Gets a value indicating the maximum outbound speed in bits per second. |
Methods
| GetConnectedProfileAsync() |
Gets the connection profile currently associated with the network adapter. |