You're not really writing a program to get a list of SSIDs and connect to them. If that was the case, you'd be using the Wireless Network API.
You're writing a program to ask another program what the list of SSIDs are.
Well, you can use the same technique to net NETSH to connect to another SSID. The command would look something like:
netsh wlan connect name={profile name} ssid={ssid to connect}
Of course, you need the profile name first. This means you have to use the command
netsh wlan show interfaces
and parse the result to get the Name, Radio type and Profile fields. The radio type will give you which interface to try and use. After all, you can't connect to an 802.11g SSID on a Bluetooth interface.
Once you have that table, you can use the Connect command as layed out above with the information in the table.