Skip to main content
NetworkInformation.GetInternetConnectionProfile | getInternetConnectionProfile method

Gets the connection profile associated with the internet connection currently used by the local machine.


var connectionProfile = Windows.Networking.Connectivity.NetworkInformation.getInternetConnectionProfile();

public static ConnectionProfile GetInternetConnectionProfile()

Public Shared Function GetInternetConnectionProfile() As ConnectionProfile

static ConnectionProfile^ GetInternetConnectionProfile()


This method has no parameters.

Return value

Type: ConnectionProfile

The profile for the connection currently used to connect the machine to the Internet, or null if there is no connection profile with a suitable connection.


To be notified of changes in connectivity, register a handler with the NetworkStatusChanged event. When a notification is received of a network status change, call the GetInternetConnectionProfile method to get the current connection profile which can then be stored for later use when needed.

The following example demonstrates how to retrieve a ConnectionProfile. The function calls getInternetConnectionProfile to retrieve the ConnectionProfile representing the connection currently used for Internet connectivity. Alternatively, your app can call getConnectionProfiles to retrieve all available connections on a device.

var networkInfo = Windows.Networking.Connectivity.NetworkInformation;

//Retrieve the ConnectionProfile
var internetConnectionProfile = networkInfo.getInternetConnectionProfile();

//Pass the returned object to a function that accesses the connection data  
var connectionProfileInfo = getConnectionProfileInfo(internetConnectionProfile);

using namespace Windows::Networking::Connectivity;

//Retrieve the ConnectionProfile
ConnectionProfile^ InternetConnectionProfile = NetworkInformation::GetInternetConnectionProfile();

//Pass the returned object to a function that accesses the connection data        
String^ strConnectionProfileInfo = GetConnectionProfileInfo(InternetConnectionProfile);

using Windows.Networking.Connectivity;

//Retrieve the ConnectionProfile
string connectionProfileInfo = string.Empty;
ConnectionProfile InternetConnectionProfile = NetworkInformation.GetInternetConnectionProfile();

//Pass the returned object to a function that accesses the connection data  
connectionProfileInfo = GetConnectionProfileInfo(InternetConnectionProfile);

If more than one connection profile is currently connecting the machine to the internet, the preferred profile is returned by this method. The preferred profile represents the connection that is the most likely to be used when sending and receiving traffic to and from the internet.

For additional examples of how NetworkInformation class methods are implemented to retrieve connection profiles, see Quickstart: Retrieving network connection information.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0 [for Xbox, see UWP features that aren't yet supported on Xbox]

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

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8


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



See also