S
Srini
How do I discover the networks detected by my Wi-Fi adapter?
I tried to use WMI. It shows information of the connected network
only.
There are some other WiFi access points available. But I am not able
to retrieve them using WMI(using c# code). The code which I tried is
given below.
Please let me know if we can detect other access points, which is
available and not currently connected with my adapter.
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\WMI",
"SELECT * FROM
MSNdis_80211_ServiceSetIdentifier");
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("-----------------------------------");
Console.WriteLine("MSNdis_80211_ServiceSetIdentifier instance");
Console.WriteLine("-----------------------------------");
if(queryObj["Ndis80211SsId"] == null)
Console.WriteLine("Ndis80211SsId: {0}",
queryObj["Ndis80211SsId"]);
else
{
Byte[] arrNdis80211SsId = (Byte[])
(queryObj["Ndis80211SsId"]);
foreach (Byte arrValue in arrNdis80211SsId)
{
Console.WriteLine("Ndis80211SsId: {0}",
arrValue);
}
}
}
Thanks
Srinivasan
I tried to use WMI. It shows information of the connected network
only.
There are some other WiFi access points available. But I am not able
to retrieve them using WMI(using c# code). The code which I tried is
given below.
Please let me know if we can detect other access points, which is
available and not currently connected with my adapter.
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\WMI",
"SELECT * FROM
MSNdis_80211_ServiceSetIdentifier");
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("-----------------------------------");
Console.WriteLine("MSNdis_80211_ServiceSetIdentifier instance");
Console.WriteLine("-----------------------------------");
if(queryObj["Ndis80211SsId"] == null)
Console.WriteLine("Ndis80211SsId: {0}",
queryObj["Ndis80211SsId"]);
else
{
Byte[] arrNdis80211SsId = (Byte[])
(queryObj["Ndis80211SsId"]);
foreach (Byte arrValue in arrNdis80211SsId)
{
Console.WriteLine("Ndis80211SsId: {0}",
arrValue);
}
}
}
Thanks
Srinivasan