NetworkInformation Class

Definition

Provides access to network connection information for the local machine.

public ref class NetworkInformation abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.Networking.Connectivity.INetworkInformationStatics2, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Static(Windows.Networking.Connectivity.INetworkInformationStatics, 65536, Windows.Foundation.UniversalApiContract)]
class NetworkInformation abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.Networking.Connectivity.INetworkInformationStatics2, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.Networking.Connectivity.INetworkInformationStatics, 65536, "Windows.Foundation.UniversalApiContract")]
class NetworkInformation abstract sealed
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.Networking.Connectivity.INetworkInformationStatics2), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Static(typeof(Windows.Networking.Connectivity.INetworkInformationStatics), 65536, typeof(Windows.Foundation.UniversalApiContract))]
public static class NetworkInformation
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=100794368)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.Networking.Connectivity.INetworkInformationStatics2), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.Networking.Connectivity.INetworkInformationStatics), 65536, "Windows.Foundation.UniversalApiContract")]
public static class NetworkInformation
Public Class NetworkInformation
Inheritance
NetworkInformation
Attributes

Windows 10 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

For examples of how NetworkInformation class methods are implemented, see Quickstart: Retrieving network connection information.

Methods

FindConnectionProfilesAsync(ConnectionProfileFilter)

Returns an array of ConnectionProfile objects that match the filtering criteria defined by ConnectionProfileFilter.

GetConnectionProfiles()

Gets a list of profiles for connections, active or otherwise, on the local machine.

GetHostNames()

Gets a list of host names associated with the local machine.

GetInternetConnectionProfile()

Gets the connection profile associated with the internet connection currently used by the local machine.

GetLanIdentifiers()

Gets an array of LanIdentifier objects that contain locality information for each NetworkAdapter object that currently connected to a network.

GetProxyConfigurationAsync(Uri)

Gets proxy configuration for a connection using the specified URI.

Note

This class method is not supported on Windows Phone.

GetSortedEndpointPairs(IEnumerable<EndpointPair>, HostNameSortOptions)

Gets a sorted list of EndpointPair objects.

Events

NetworkStatusChanged

Occurs when the network status changes for a connection.

Applies to

See also