I would like to check internet connectivity type in Windows Universal Application.
I use NetworkInformation.GetInternetConnectionProfile().IsWlanConnectionProfile
and IsWwanConnectionProfile
. If neither is true
, it should mean you're on Ethernet or something like that.
Keep in mind thatGetInternetConnectionProfile()
can return null and can falsely return that there is an active internet connection when the connection is active but DHCP has failed.