Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Finding your IP address I have already covered, now for the next useful thing: your SSID name.
Although MSDN documentation seems a little sparse in this area, this function works well for me so far. Note that simply enumerating until you get a wireless network is insufficient, as recently-used networks also show up: the trick is to also check the connection state.
public string GetSSIDName()
{
foreach (var network in new NetworkInterfaceList())
{
if (
(network.InterfaceType == NetworkInterfaceType.Wireless80211) &&
(network.InterfaceState == ConnectState.Connected)
)
{
return network.InterfaceName;
}
}
return "<Not connected>";
}