ConnectionProfile, classe
TOC
Réduire la table des matières
Développer la table des matières

ConnectionProfile Class

Représente une connexion réseau qui inclut le réseau actuellement connecté ou les connexions réseau antérieures. Fournit des informations sur les statistiques d'état de connexion et de connectivité.

Syntaxe


var connectionProfile = getInternetConnectionProfile();

Attributs

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

Membres

ConnectionProfileClasse possède ces types de membres :

Méthodes

The ConnectionProfile Classe a les méthodes suivantes. Avec C#, Visual Basic et C++, elle hérite également des méthodes de Object Classe.

MéthodeDescription
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.

 

Propriétés

Le ConnectionProfileClasse a les propriétés suivantes.

PropriétéType d'accèsDescription

IsWlanConnectionProfile

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

IsWwanConnectionProfile

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

NetworkAdapter

En lecture seuleGets the object representing the network adapter providing connectivity for the connection.

NetworkSecuritySettings

En lecture seuleRetrieves the security settings for the network.

ProfileName

En lecture seuleGets the name of the connection profile.

ServiceProviderGuid

En lecture seuleGets the ID of the network operator who provisioned the connection profile.

WlanConnectionProfileDetails

En lecture seuleContains properties and methods defined by WlanConnectionProfile that are specific to WLAN (WiFi) connections.

WwanConnectionProfileDetails

En lecture seuleContains the properties and methods defined by WwanConnectionProfile that are specific to mobile broadband connections.

 

Remarques

L'exemple de fonction suivant montre comment récupérer des données dans un 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";
}


Pour obtenir plus d'exemples sur le mode d'implémentation de ces méthodes de classe afin d'accéder aux informations de connexion, consultez le document Quickstart: Retrieving network connection information.

Conditions requises

Client minimal pris en charge

Windows 8 [Applications Windows Store, applications de bureau]

Serveur minimal pris en charge

Aucun pris en charge [Applications Windows Store, applications de bureau]

Téléphone minimal pris en charge

Windows Phone 8

Espace de noms

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

Métadonnées

Windows.winmd

 

 

Afficher:
© 2017 Microsoft