问题描述
我在这上面花了很长时间,但我被困住了.
我正在尝试以编程方式连接到已知的隐藏 SSID.
我正在使用以下代码
await firstAdapter.ScanAsync();WiFiAvailableNetwork 网络 = firstAdapter.NetworkReport.AvailableNetworks.FirstOrDefault(n => n.Ssid == ssid);
问题是我需要首先提供 WiFiAvailableNetwork
类型的对象,但 AvailableNetworks
只带回非隐藏的 SSID.
public IAsyncOperationConnectAsync(WiFiAvailableNetwork availableNetwork, WiFiReconnectionKind reconnectionKind, PasswordCredential passwordCredential, String ssid)
以上代码与非隐藏 SSID 完美配合.
是否有连接到隐藏 SSID 的 API?
谢谢
如果可用,隐藏网络应该在 firstAdapter.NetworkReport.AvailableNetworks
列表中.
由于 SSID 被隐藏,目标网络的 WiFiAvailableNetwork
的 Ssid
属性将为 ""
.
您可以在此处进行假设并尝试使用以下方法连接到它:
await firstAdapter.ConnectAsync(networks.First(x => x.Ssid == ""), WiFiReconnectionKind.Automatic, "password", "knownSSID");
I have spent ages on this and I am stuck.
I am trying to connect to a known hidden SSID programmatically.
I am using the following code
await firstAdapter.ScanAsync();
WiFiAvailableNetwork network = firstAdapter.NetworkReport.AvailableNetworks.FirstOrDefault(n => n.Ssid == ssid);
The problem is I need to supply as a first an object of type WiFiAvailableNetwork
but AvailableNetworks
only brings back non-hidden SSIDs.
public IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork availableNetwork, WiFiReconnectionKind reconnectionKind, PasswordCredential passwordCredential, String ssid)
The above code works perfectly with non-hidden SSID's.
Is there an API to connect to a hidden SSID?
Thanks
If available, the hidden network should be in the firstAdapter.NetworkReport.AvailableNetworks
list.
As the SSID is hidden, the Ssid
property of WiFiAvailableNetwork
for the target network will be ""
.
You could make an assumption here and attempt to connect to it using:
await firstAdapter.ConnectAsync(networks.First(x => x.Ssid == ""), WiFiReconnectionKind.Automatic, "password", "knownSSID");
这篇关于如何以编程方式连接到 Windows 10 中的隐藏 SSID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!