ConnectionProfile class

Applies to Windows and Windows Phone

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

Syntax


public ref class ConnectionProfile sealed 

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Members

The ConnectionProfile class has these types of members:

Methods

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

MethodDescription
GetAttributedNetworkUsageAsync Gets network usage data for each individual application.
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.

 

Properties

The ConnectionProfile class has these properties.

PropertyAccess typeDescription

IsWlanConnectionProfile

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

IsWwanConnectionProfile

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

NetworkAdapter

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

NetworkSecuritySettings

Read-onlyRetrieves the security settings for the network.

ProfileName

Read-onlyGets the name of the connection profile.

ServiceProviderGuid

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

WlanConnectionProfileDetails

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

WwanConnectionProfileDetails

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

 

Remarks

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

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

None supported [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

 

 

Show:
© 2014 Microsoft