如何通过编程检测弱信号强度(互联网、Wi-Fi、移动数据等)在通用Windows应用程序中??
我正在开发一个通用的Windows应用程序,在其中我想知道如何检测弱信号互联网强度是否可能是LAN,Wi-fi,蜂窝数据,我如何检测连接/信号强度是否很慢或非常差等。
有没有什么方法可以让我在通用Windows应用程序中知道这一点?
请告诉我可以用来实现这一点的各种选择
请让我知道。
发布于 2016-09-30 04:27:20
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;
}
发布于 2016-09-30 18:01:58
如何通过编程检测微弱信号强度(互联网、Wi-Fi、移动数据等)在通用Windows应用程序中??
正如@Stefano Balzarotti发布的,您可以使用NetworkInformation类的GetConnectionProfiles方法来获取连接配置文件列表。
如何检测连接/信号强度是否很慢或非常差等。
你可以从ConnectionProfile.GetSignalBars 方法的结果中得到信号强度。
官方示例Network information sample已经完成了您想要的功能的演示,您可以下载进行测试。
https://stackoverflow.com/questions/39778105
复制相似问题