Created
October 13, 2012 04:53
-
-
Save JuanKRuiz/3883275 to your computer and use it in GitHub Desktop.
Detects Internet Conectivity in WinRT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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