private void Form1_Load(object sender, EventArgs e)         {             listen_th = new Thread(new ThreadStart(listening));             listen_th.Start();             //------------------- Create WiFi -----------------//             foreach (WlanClient.WlanInterface wlanIface in client.Interfaces)             {                 //Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0);                 //Wlan.Dot11Ssid ssid = new Wlan.Dot11Ssid();                 //string xml = wlanIface.GetProfileXml("scater");                 string xml_scater = "<?xml version=\"1.0\"?>\r\n<WLANProfile xmlns=\"http://www.microsoft.com/networking/WLAN/profile/v1\">\r\n\t<name>scater</name>\r\n\t<SSIDConfig>\r\n\t\t<SSID>\r\n\t\t\t<hex>736361746572</hex>\r\n\t\t\t<name>scater</name>\r\n\t\t</SSID>\r\n\t\t<nonBroadcast>false</nonBroadcast>\r\n\t</SSIDConfig>\r\n\t<connectionType>IBSS</connectionType>\r\n\t<connectionMode>manual</connectionMode>\r\n\t<MSM>\r\n\t\t<security>\r\n\t\t\t<authEncryption>\r\n\t\t\t\t<authentication>open</authentication>\r\n\t\t\t\t<encryption>none</encryption>\r\n\t\t\t\t<useOneX>false</useOneX>\r\n\t\t\t</authEncryption>\r\n\t\t</security>\r\n\t</MSM>\r\n</WLANProfile>\r\n";                 wlanIface.SetProfile(Wlan.WlanProfileFlags.AllUser, xml_scater, true);  //736361746572                 wlanIface.Connect(Wlan.WlanConnectionMode.Profile, Wlan.Dot11BssType.Any, "scater");                 //wlanIface.Connect(Wlan.WlanConnectionMode.DiscoverySecure, Wlan.Dot11BssType.Any, ssid,Wlan.WlanConnectionFlags.EapolPassthrough);             }             //--------------------------------------------------//         }         private void Form1_FormClosed(object sender, FormClosedEventArgs e)         {              listen_th.Abort(listen_th.ThreadState);             listener.Close();             d.Abort();         }