使用 C# 连接到隐藏(非广播)网络? [英] Connect to hidden (non-broadcast) network using c#?

查看:93
本文介绍了使用 C# 连接到隐藏(非广播)网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种通过 C# 连接到非广播(隐藏)网络的方法.这对我来说是一个新的发展领域.它是一个需要能够管理 WiFi 连接的 UWP 应用程序.我目前正在使用 Windows.Devices.Wifi 命名空间来做几乎所有其他事情,但我不知道如何进行非广播.我有网络的 SSID 和密码.我可能会遗漏一些东西,这可能很容易做到,但我遗漏了一些东西.有谁能帮帮我吗?

I am looking for a way to connect to a non-broadcast (hidden) network via C#. This is a new area of development for me. It is a UWP application that needs to be able to manage WiFi connections. I am currently using the Windows.Devices.Wifi namespace to do pretty much everything else, but I don't know how to do the non-broadcast. I have the SSID and the password for the network. I might be missing something, and it could be really easy to do, but I am missing something. Anyone able to help me out?

推荐答案

你可以像我一样使用 bssid 来获取 WiFiAvailableNetwork:-

You can use bssid to get the WiFiAvailableNetwork like I have done:-

等待wifiAdapter.ScanAsync();var wifiList= wifiList.AddRange(wifiAdapter.NetworkReport.AvailableNetworks.ToList());

await wifiAdapter.ScanAsync(); var wifiList= wifiList.AddRange(wifiAdapter.NetworkReport.AvailableNetworks.ToList());

WiFiAvailableNetwork targetWifi = wifiList.FirstOrDefault(x => x.Bssid.Equals("00:19:a9:7f:08:a0"));

WiFiAvailableNetwork targetWifi = wifiList.FirstOrDefault(x => x.Bssid.Equals("00:19:a9:7f:08:a0"));

这篇关于使用 C# 连接到隐藏(非广播)网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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