MSDN Library
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ConnectionProfile class

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


var connectionProfile = getInternetConnectionProfile();


The ConnectionProfile class has these types of members:


The ConnectionProfile class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

GetAttributedNetworkUsageAsync Gets network usage data for each individual application. This method is only supported in a Windows Phone Store app.
GetConnectionCost Gets the cost information for the connection.
GetConnectivityIntervalsAsync 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 Gets the current status of the data plan associated with the connection.
GetDomainConnectivityLevel Gets the current domain authentication status for a network connection. Possible values are defined by DomainConnectivityLevel.
GetLocalUsage(DateTime, DateTime) Gets the estimated data usage for a connection during over a specific period of time.
GetLocalUsage(DateTime, DateTime, RoamingStates) Gets the estimated data usage for a connection over a specific period of time and roaming state.
GetNetworkConnectivityLevel Gets the network connectivity level for this connection. This value indicates what network resources, if any, are currently available.
GetNetworkNames Retrieves names associated with the network with which the connection is currently established.
GetNetworkUsageAsync Gets a list of the estimated data traffic and connection duration over a specified period of time, for a specific network usage state.
GetSignalBars Gets a value that indicates the current number of signal bars displayed by the Windows UI for the connection.



The ConnectionProfile class has these properties.

PropertyAccess typeDescription


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


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


Read-onlyGets the object representing the network adapter providing connectivity for the connection.


Read-onlyRetrieves the security settings for the network.


Read-onlyGets the name of the connection profile.


Read-onlyGets the ID of the network operator who provisioned the connection profile.


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


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



The following example function demonstrates how 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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::Networking::Connectivity [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8


Windows::Networking::Connectivity [C++]





See also




© 2016 Microsoft