使用 WinRt 列出和连接 WiFi [英] Listing and connecting WiFi using WinRt

查看:40
本文介绍了使用 WinRt 列出和连接 WiFi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的办公室里,我有 10 个 WiFi 路由器.我想列出所有这些(类似于 Windows 8 系统托盘中的网络图标)并通过 Win Rt 连接/断开其中之一.

In my office I have 10 WiFi routers.I want to list all those(similar to Network icon in the system tray on windows 8) and connect/disconnect to one of them through Win Rt.

我尝试了这些 API

 Windows::Networking::Connectivity::NetworkInformation::GetLanIdentifiers();
 Windows::Networking::Connectivity::NetworkInformation::GetConnectionProfiles();
 NetworkInformation::GetInternetConnectionProfile();

但是这些Api只列出了连接的一个,不列出其他的

but these Api only list connected one, it doesn't list others

我可以使用 http://msdn.microsoft.com/en-us/library/windows/desktop/ms706716(v=vs.85).aspx.但我不确定 Windows 8 地铁模式是否支持此 Api.

I can achieve this using http://msdn.microsoft.com/en-us/library/windows/desktop/ms706716(v=vs.85).aspx. But I am not sure this Api will be supported on Windows 8 metro mode.

WinRt 是否为此提供 Api 支持??

Does WinRt provides Api support for this ??

推荐答案

您无法从 Windows 应用程序连接/断开网络.您只能查看信息.原因是(对于 Microsoft)连接管理器可以从您的应用程序通过超级按钮栏访问.

You cannot connect/disconnect to a network from a Windows App. You can only check informations. The reason is (for Microsoft) that the connection manager is accessible from your app through the charms bar.

此功能不对 Metro 风格应用程序公开.运营商的应用程序可以为其网络(具有已知 SSID)创建配置文件,但列出和连接到可见网络是由用户通过 Windows 连接管理 UI 控制的,而不是由应用程序控制.[Mike Bishop [MSFT],这里]

This functionality is not exposed to Metro style applications. An operator's app can create profiles for their networks (with known SSIDs), but listing and connecting to visible networks is controlled by the user via the Windows connection management UI, not by an application. [Mike Bishop [MSFT], here]

高级连接功能存在于 Windows.Networking.NetworkOperators,哪些功能仅适用于移动运营商应用程序和移动网络运营商授予特权访问权限的 Windows 应用商店应用程序.

The advanced connectivity functionnalities are present in Windows.Networking.NetworkOperators, which functionalities are only available to mobile operator apps and Windows Store apps given privileged access by mobile network operators.

看看微软的网络信息示例展示了您可以使用此 API 实现的目标.

Take a look at the Microsoft's Network information sample which shows what you can achieve with this API.

这篇关于使用 WinRt 列出和连接 WiFi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆