Skip to content

Instantly share code, notes, and snippets.

@JuanKRuiz
Created October 13, 2012 04:53
Show Gist options
  • Save JuanKRuiz/3883275 to your computer and use it in GitHub Desktop.
Save JuanKRuiz/3883275 to your computer and use it in GitHub Desktop.
Detects Internet Conectivity in WinRT
/// <summary>
/// Detects Internet Access Connectivity in WinRT
/// </summary>
/// <remarks>
/// This is a Property to put into a class
/// requires using Windows.Networking.Connectivity;
/// </remarks>
public static bool InternetConectivity
{
get
{
var prof = NetworkInformation.GetInternetConnectionProfile();
return prof != null && prof.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment