LanIdentifier 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 physical identification data for a specific NetworkAdapter object. Retrieve
LanIdentifier instances through NetworkInformation.GetLanIdentifiers.
public ref class LanIdentifier sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class LanIdentifier final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class LanIdentifier
Public NotInheritable Class LanIdentifier
- 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)
|
Examples
Enumerate LAN identifiers (C#):
using Windows.Networking.Connectivity;
var identifiers = NetworkInformation.GetLanIdentifiers();
foreach (var id in identifiers)
{
var infra = id.InfrastructureId;
var port = id.PortId;
var type = id.NetworkAdapterId;
// App-specific: correlate infra/port values with diagnostics telemetry.
}
Remarks
Location data is expressed either as a BSSID if the network adapter media type is Wireless LAN, or as a tuple <ChassisId, Port Number> if the network adapter type is Ethernet. The data is represented according to the LLDP protocol.
Properties
| InfrastructureId |
Gets a LanIdentifierData object containing locality identification information for the network adapter's connection. |
| NetworkAdapterId |
Gets the adapter GUID that identifies the network adapter to associate with the locality information. |
| PortId |
Gets a LanIdentifierData object containing the port ID from the Link Layer Discovery Protocol (LLDP) locality information for an Ethernet type network adapter. |