I am not able to get a WPA SSID list.

Apr 3, 2014 at 6:16 PM
How to get the SSID list?
using NativeWifi;
using System.Text;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

        }
        static string GetStringForSSID(Wlan.Dot11Ssid ssid)
        {
            return Encoding.ASCII.GetString(ssid.SSID, 0, (int)ssid.SSIDLength);
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            WlanClient client = new WlanClient();
            label1.Text = ("Initialized");
            foreach (WlanClient.WlanInterface wlanIface in client.Interfaces)
            {
                label1.Text = ("Iterfaces");
                Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0);
                foreach (Wlan.WlanAvailableNetwork network in networks)
                {
                    label1.Text = ("Found networks");
                    if (network.dot11DefaultCipherAlgorithm == Wlan.Dot11CipherAlgorithm.WPA_UseGroup)
                    {
                        label1.Text = ("Found WPA");
                    } if (network.dot11DefaultCipherAlgorithm == Wlan.Dot11CipherAlgorithm.WEP)
                    {
                        String n="";
                        n = network.dot11Ssid.SSID.ToString();
                        listBox1.Items.Add(n);
                        label1.Text = ("Found WEP network with SSID");
                    }
                    
                }
            }
            
        }
    }
}