【发布时间】:2020-06-14 14:13:27
【问题描述】:
我需要获取当前连接到的网络的SSID。
这是我用来在 Xamarin.Android 中查找 SSID 的代码:
WifiManager wifiManager = (WifiManager)(Application.Context.GetSystemService(WifiService));
if (wifiManager != null)
{
var ssid = wifiManager.ConnectionInfo.SSID;
}
else
{
var str = "WiFiManager is NULL";
}
但我需要在 Xamarin.Forms 中实现这一点。
我该怎么做?
【问题讨论】:
-
对不起,在我的 anwser 上我说 Dependency(typeof()) 是 IGetSSID,这是不正确的,我已经更新了我的 anwser,它是 Dependency(typeof(GetSSIDAndroid))
标签: c# xamarin.forms xamarin.android wifi ssid