I use this NativeWifi library to get the name of WiFi.
I'm testing with VMWARE and I get an exception:
Message: "The service has not been started"
NativeErrorCode: 1062.
Source: "ManagedWifi";
Follow code:
try
{
WlanClient wlanClient = new WlanClient(); // <-------------- problem is here
List<String> list = new List<String>();
foreach (WlanInterface wlanInterface in wlanClient.Interfaces)
{
if (wlanInterface.InterfaceState == Wlan.WlanInterfaceState.Connected)
{
Wlan.Dot11Ssid ssid = wlanInterface.CurrentConnection.wlanAssociationAttributes.dot11Ssid;
list.Add(new String(Encoding.ASCII.GetChars(ssid.SSID, 0, (int)ssid.SSIDLength)));
}
}
return list.FirstOrDefault();
}
catch (Exception ex)
{
return $"Error: {ex.Message}";
}
The problem occurs on the line: WlanClient wlanClient = new WlanClient();
.
This problem happens in the virtual machine (VMware).
Any Solution ?