Gets a list of profiles for connections, active or otherwise, on the local machine.
Syntax
var iVectorView = Windows.Networking.Connectivity.NetworkInformation.getConnectionProfiles();
Parameters
This method has no parameters.
Return value
Type: IVectorView<ConnectionProfile> [JavaScript/C++] | System.Collections.Generic.IReadOnlyList<ConnectionProfile> [.NET]
An array of ConnectionProfile objects.
Remarks
The following example demonstrates how to retrieve a ConnectionProfile. The function calls getConnectionProfiles to retrieve all available connections on a device and display using a list. Alternatively, your app can call getInternetConnectionProfile to retrieve the ConnectionProfile representing the connection currently used for Internet connectivity.
function DisplayConnectionProfileList() { var profileList = ""; var ConnectionProfiles = networkInfo.getConnectionProfiles(); if (ConnectionProfiles.length !== 0) { for (var i = 0; i < ConnectionProfiles.length; i++) { //Display Connection profile info for each profile by passing it //to a function that accesses and displays the connection properties profileList += getConnectionProfileInfo(ConnectionProfiles[i]); profileList += "-------------------------\n\r"; } mySample.displayStatus(profileList); } else { mySample.displayStatus("No profiles found"); } } catch (e) { mySample.displayError("Exception Caught: " + e + "\n\r"); } }
For additional examples of how NetworkInformation class methods are implemented to retrieve connection profiles, see Quickstart: Retrieving network connection information.
Windows Phone 8
This API is not implemented and will throw an exception if called.
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 2/25/2013