Uwp 如何在通用Windows应用程序中以编程方式检测微弱的互联网信号强度(互联网、Wi-Fi、手机数据等)?

Uwp 如何在通用Windows应用程序中以编程方式检测微弱的互联网信号强度(互联网、Wi-Fi、手机数据等)?,uwp,windows-10,windows-10-universal,uwp-xaml,Uwp,Windows 10,Windows 10 Universal,Uwp Xaml,如何通过编程在通用Windows应用程序中检测弱信号强度(互联网、Wi-Fi、移动数据等) 我正在开发一个通用Windows应用程序,我想知道如何检测弱信号互联网强度,无论是LAN、Wi-fi、蜂窝数据,如何检测连接/信号强度是否缓慢或非常差等 有什么方法可以让我在通用Windows应用程序中知道这一点吗 请让我知道我可以通过哪些选项来实现这一目标 请让我知道 foreach (ConnectionProfile profile in NetworkInformation.GetConnecti

如何通过编程在通用Windows应用程序中检测弱信号强度(互联网、Wi-Fi、移动数据等)

我正在开发一个通用Windows应用程序,我想知道如何检测弱信号互联网强度,无论是LAN、Wi-fi、蜂窝数据,如何检测连接/信号强度是否缓慢或非常差等

有什么方法可以让我在通用Windows应用程序中知道这一点吗

请让我知道我可以通过哪些选项来实现这一目标

请让我知道

foreach (ConnectionProfile profile in NetworkInformation.GetConnectionProfiles()) //Get all active profiles (LAN, bluetooth, wifi, Cellular data, etc..)
{
   NetworkConnectivityLevel level = profile.GetNetworkConnectivityLevel(); //Get connectivity level for profile
   /*NetworkConnectivityLevel.InternetAccess         
                              ConstrainedInternetAccess
                              LocalAccess
                              None*/
  Byte signal = profile.GetSignalBars(); //Returns the signal level
  bool isWifi = profile.IsWlanConnectionProfile;
  bool isCellularData = profile.IsWwanConnectionProfile;
}
如何通过编程在通用Windows应用程序中检测弱信号强度(互联网、Wi-Fi、移动数据等)

正如@Stefano Balzarotti所发布的,您可以使用类的方法来获取连接配置文件列表

如何检测连接/信号强度是否缓慢或非常差等

你可以从方法的结果中得到信号强度

官方示例已经完成了有关您想要的功能的演示,您可以下载进行测试

如何通过编程在通用Windows应用程序中检测弱信号强度(互联网、Wi-Fi、移动数据等)

正如@Stefano Balzarotti所发布的,您可以使用类的方法来获取连接配置文件列表

如何检测连接/信号强度是否缓慢或非常差等

你可以从方法的结果中得到信号强度

官方示例已经完成了有关您想要的功能的演示,您可以下载进行测试