简体   繁体   English

检测Windows应用商店应用中的WIFI连接

[英]Detect WIFI connection in Windows Store App

I need to detect if the device my app is running on is currently connected to a WIFI network. 我需要检测我的应用程序运行的设备当前是否连接到WIFI网络。 I have read the guidance I know i can determine the "connection cost" but i specifically want to know if there is a way to tell if the device is connected to WIFI or not. 我已经阅读我知道可以确定“连接成本”的指导,但我特别想知道是否有办法判断设备是否连接到WIFI。

I found the solution: 我找到了解决方案:

http://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.connectivity.networkadapter.ianainterfacetype http://msdn.microsoft.com/en-us/library/windows/apps/windows.networking.connectivity.networkadapter.ianainterfacetype

now you can do something like this: 现在你可以这样做:

switch (internetConnectionProfile.NetworkAdapter.IanaInterfaceType)
                {
                    case 71:
                        networkStatus = InternetAccess.WLAN;
                        break;

 ect....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM