Information
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.

NetworkInformation.GetConnectionProfiles | getConnectionProfiles method

Applies to Windows and Windows Phone

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.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

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

Metadata

Windows.winmd

See also

NetworkInformation

 

 

Show:
© 2014 Microsoft