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:

Monday, May 17, 2004 6:50:04 PM (GMT Daylight Time, UTC+01:00)
I can't find the AdapterCollection class in the beta 1 of Whidbey (I'm still using it because it's the only version where the framework remains integrated with Yukon). Anyway, I was wondering whether it got snuck in after the Beta 1 release, or will this be released in a future update to the CF.NET framework? Also, will the class be available in the full .NET Framework (I'm assuming that there's a new namespace called System.Networking, right)?
Monday, May 17, 2004 7:06:48 PM (GMT Daylight Time, UTC+01:00)
Doug,

The AdapterCollection class is from the Smart Device Framework, not the .NET Compact Framework. The code shown can be used in SDF v1.1, which we will be releasing shortly.
Neil
Monday, May 17, 2004 8:34:24 PM (GMT Daylight Time, UTC+01:00)
Makes sense why I couldn't find it. Can you tell me how compatible the libraries are? WIll they work with both Whidbey & VS.NET 2003?
Comments are closed.