Send mail to the author(s)

May 14, 2004

Finding your current WiFi SSID

Yesterday, Steve blogged how to retrieve your current WiFi access point using WMI. Well, we have this in the upcoming Smart Device Framework v1.1. The API is simple to use (I think so, anyways).

AdapterCollection adapters = Networking.GetAdapters();
foreach( Adapter nic in adapters )
{
    if( nic.IsWireless )
    {
        string adapterName = nic.Name;
        string ssidName = nic.AssociatedAccessPointName;
        string signalStrength = nic.SignalStrength.ToString();

        textBox1.Text = string.Format("{0}\r\n{1}\r\n{2}",adapterName,ssidName,signalStrength);
    }
}

This would produce output like this from the Dell Axim I have to hand:

And on my iPAQ with the dodgy 802.11b stack: