ConnectionProfile ConnectionProfile ConnectionProfile ConnectionProfile ConnectionProfile Class

Definition

Represents a network connection, which includes either the currently connected network or prior network connections. Provides information about the connection status and connectivity statistics.

public : sealed class ConnectionProfile : IConnectionProfile, IConnectionProfile2, IConnectionProfile3, IConnectionProfile4, IConnectionProfile5
struct winrt::Windows::Networking::Connectivity::ConnectionProfile : IConnectionProfile, IConnectionProfile2, IConnectionProfile3, IConnectionProfile4, IConnectionProfile5
public sealed class ConnectionProfile : IConnectionProfile, IConnectionProfile2, IConnectionProfile3, IConnectionProfile4, IConnectionProfile5
Public NotInheritable Class ConnectionProfile Implements IConnectionProfile, IConnectionProfile2, IConnectionProfile3, IConnectionProfile4, IConnectionProfile5
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The following example function demonstrates how to retrieve data from a ConnectionProfile.

function getConnectionProfileInfo(connectionProfile) {

     returnString += "Connection Cost Information:\n\r";
     returnString += "===============\n\r";
     var connectionCost = connectionProfile.getConnectionCost();
     returnString += "Cost Type: " + getCostType(connectionCost.networkCostType) + "\n\r";
     returnString += "Roaming: " + connectionCost.roaming + "\n\r";
     returnString += "Over Datalimit: " + connectionCost.overDataLimit + "\n\r";
     returnString += "Approaching Datalimit: " + connectionCost.approachingDataLimit + "\n\r";
}

For more examples of how these class methods are implemented to access connection information, see Quickstart: Retrieving network connection information.

Properties

CanDelete CanDelete CanDelete CanDelete CanDelete

Gets a value that indicates whether or not it is possible to delete this connection profile. This can help determine whether TryDeleteAsync is likely to succeed.

IsWlanConnectionProfile IsWlanConnectionProfile IsWlanConnectionProfile IsWlanConnectionProfile IsWlanConnectionProfile

Gets a value that indicates if connection profile is a WLAN (WiFi) connection. This determines whether or not WlanConnectionProfileDetails is null.

IsWwanConnectionProfile IsWwanConnectionProfile IsWwanConnectionProfile IsWwanConnectionProfile IsWwanConnectionProfile

Gets a value that indicates if connection profile is a WWAN (mobile) connection. This determines whether or not WwanConnectionProfileDetails is null.

NetworkAdapter NetworkAdapter NetworkAdapter NetworkAdapter NetworkAdapter

Gets the object representing the network adapter providing connectivity for the connection.

NetworkSecuritySettings NetworkSecuritySettings NetworkSecuritySettings NetworkSecuritySettings NetworkSecuritySettings

Retrieves the security settings for the network.

ProfileName ProfileName ProfileName ProfileName ProfileName

Gets the name of the connection profile.

ServiceProviderGuid ServiceProviderGuid ServiceProviderGuid ServiceProviderGuid ServiceProviderGuid

Gets the ID of the network operator who provisioned the connection profile.

WlanConnectionProfileDetails WlanConnectionProfileDetails WlanConnectionProfileDetails WlanConnectionProfileDetails WlanConnectionProfileDetails

Gets a WlanConnectionProfileDetails object that provides a method for retrieving information specific to a WLAN (WiFi) connection.

WwanConnectionProfileDetails WwanConnectionProfileDetails WwanConnectionProfileDetails WwanConnectionProfileDetails WwanConnectionProfileDetails

Gets a WwanConnectionProfileDetails object containing the properties and methods used to retrieve information specific to mobile broadband connections.

Methods

GetAttributedNetworkUsageAsync(DateTime, DateTime, NetworkUsageStates) GetAttributedNetworkUsageAsync(DateTime, DateTime, NetworkUsageStates) GetAttributedNetworkUsageAsync(DateTime, DateTime, NetworkUsageStates) GetAttributedNetworkUsageAsync(DateTime, DateTime, NetworkUsageStates) GetAttributedNetworkUsageAsync(DateTime, DateTime, NetworkUsageStates)

Gets network usage data for each individual application. This method is only supported in a Windows Phone 8.x app.

GetConnectionCost() GetConnectionCost() GetConnectionCost() GetConnectionCost() GetConnectionCost()

Gets the cost information for the connection.

GetConnectivityIntervalsAsync(DateTime, DateTime, NetworkUsageStates) GetConnectivityIntervalsAsync(DateTime, DateTime, NetworkUsageStates) GetConnectivityIntervalsAsync(DateTime, DateTime, NetworkUsageStates) GetConnectivityIntervalsAsync(DateTime, DateTime, NetworkUsageStates) GetConnectivityIntervalsAsync(DateTime, DateTime, NetworkUsageStates)

Gets a list of ConnectivityInterval objects, which indicate the timestamp for when the network connection began, and a time-span for the duration of that connection.

GetDataPlanStatus() GetDataPlanStatus() GetDataPlanStatus() GetDataPlanStatus() GetDataPlanStatus()

Gets the current status of the data plan associated with the connection.

GetDomainConnectivityLevel() GetDomainConnectivityLevel() GetDomainConnectivityLevel() GetDomainConnectivityLevel() GetDomainConnectivityLevel()

Gets the current domain authentication status for a network connection. Possible values are defined by DomainConnectivityLevel.

GetLocalUsage(DateTime, DateTime) GetLocalUsage(DateTime, DateTime) GetLocalUsage(DateTime, DateTime) GetLocalUsage(DateTime, DateTime) GetLocalUsage(DateTime, DateTime)

Note

GetLocalUsage may be altered or unavailable for releases after Windows 8.1. Instead, use GetNetworkUsageAsync

Gets the estimated data usage for a connection during over a specific period of time.

GetLocalUsage(DateTime, DateTime, RoamingStates) GetLocalUsage(DateTime, DateTime, RoamingStates) GetLocalUsage(DateTime, DateTime, RoamingStates) GetLocalUsage(DateTime, DateTime, RoamingStates) GetLocalUsage(DateTime, DateTime, RoamingStates)

Note

GetLocalUsage may be altered or unavailable for releases after Windows 8.1. Instead, use GetNetworkUsageAsync

Gets the estimated data usage for a connection over a specific period of time and roaming state.

GetNetworkConnectivityLevel() GetNetworkConnectivityLevel() GetNetworkConnectivityLevel() GetNetworkConnectivityLevel() GetNetworkConnectivityLevel()

Gets the network connectivity level for this connection. This value indicates what network resources, if any, are currently available.

GetNetworkNames() GetNetworkNames() GetNetworkNames() GetNetworkNames() GetNetworkNames()

Retrieves names associated with the network with which the connection is currently established.

GetNetworkUsageAsync(DateTime, DateTime, DataUsageGranularity, NetworkUsageStates) GetNetworkUsageAsync(DateTime, DateTime, DataUsageGranularity, NetworkUsageStates) GetNetworkUsageAsync(DateTime, DateTime, DataUsageGranularity, NetworkUsageStates) GetNetworkUsageAsync(DateTime, DateTime, DataUsageGranularity, NetworkUsageStates) GetNetworkUsageAsync(DateTime, DateTime, DataUsageGranularity, NetworkUsageStates)

Gets a list of the estimated data traffic and connection duration over a specified period of time, for a specific network usage state.

DataUsageGranularity is used to indicate the desired granularity of the returned data and affects the length of the returned list. NetworkUsageStates is used to indicate the desired network usage configuration.

GetProviderNetworkUsageAsync(DateTime, DateTime, NetworkUsageStates) GetProviderNetworkUsageAsync(DateTime, DateTime, NetworkUsageStates) GetProviderNetworkUsageAsync(DateTime, DateTime, NetworkUsageStates) GetProviderNetworkUsageAsync(DateTime, DateTime, NetworkUsageStates) GetProviderNetworkUsageAsync(DateTime, DateTime, NetworkUsageStates)

Returns the bytes sent and bytes received for each MCC and MNC combination (the combination is represented by a ProviderId ).

GetSignalBars() GetSignalBars() GetSignalBars() GetSignalBars() GetSignalBars()

Gets a value that indicates the current number of signal bars displayed by the Windows UI for the connection.

TryDeleteAsync() TryDeleteAsync() TryDeleteAsync() TryDeleteAsync() TryDeleteAsync()

Asynchronously attempts to delete this connection profile; the operation may or may not succeed. Examine the return value to determine the outcome of the operation.

See also