<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>managedwifi Forum Rss Feed</title><link>http://www.codeplex.com/managedwifi/Thread/List.aspx</link><description>managedwifi Forum Rss Description</description><item><title>New Post: How to get accesspoint IP address?</title><link>http://managedwifi.codeplex.com/discussions/440917</link><description>&lt;div style="line-height: normal;"&gt;&lt;strong&gt;activex wrote:&lt;/strong&gt;&lt;br /&gt;
&lt;blockquote&gt;
HI&lt;br /&gt;
&lt;br /&gt;
I am using Managed Wifi API and I found this code cold give me the mac address. My question is, is it possible for me to find the IP address? And, How would I find the signal strength in DB?&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;WlanClient client = new WlanClient();
        // Wlan = new WlanClient();
        try
        {
            foreach (WlanClient.WlanInterface wlanIface in client.Interfaces)
            {

                Wlan.WlanBssEntry[] wlanBssEntries = wlanIface.GetNetworkBssList();

                foreach (Wlan.WlanBssEntry network in wlanBssEntries)
                {
                    int rss = network.rssi;
                    //     MessageBox.Show(rss.ToString());
                    byte[] macAddr = network.dot11Bssid;

                    string tMac = &amp;quot;&amp;quot;;

                    for (int i = 0; i &amp;lt; macAddr.Length; i++)
                    {

                        tMac += macAddr[i].ToString(&amp;quot;x2&amp;quot;).PadLeft(2, '0').ToUpper();

                    }



                    Console.WriteLine(&amp;quot;Found network with SSID {0}.&amp;quot;, System.Text.ASCIIEncoding.ASCII.GetString(network.dot11Ssid.SSID).ToString());

                    Console.WriteLine(&amp;quot;Signal: {0}%.&amp;quot;, network.linkQuality);

                    Console.WriteLine(&amp;quot;BSS Type: {0}.&amp;quot;, network.dot11BssType);

                    Console.WriteLine(&amp;quot;MAC: {0}.&amp;quot;, tMac);

                    Console.WriteLine(&amp;quot;RSSID:{0}&amp;quot;, rss.ToString());


                }
                Console.ReadLine();
            }
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;
found it!&lt;br /&gt;
&lt;/div&gt;</description><author>activex</author><pubDate>Mon, 22 Apr 2013 17:06:00 GMT</pubDate><guid isPermaLink="false">New Post: How to get accesspoint IP address? 20130422050600P</guid></item><item><title>New Post: How to get accesspoint IP address?</title><link>http://managedwifi.codeplex.com/discussions/440917</link><description>&lt;div style="line-height: normal;"&gt;HI&lt;br /&gt;
&lt;br /&gt;
I am using Managed Wifi API and I found this code cold give me the mac address. My question is, is it possible for me to find the IP address? And, How would I find the signal strength in DB?&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;WlanClient client = new WlanClient();
        // Wlan = new WlanClient();
        try
        {
            foreach (WlanClient.WlanInterface wlanIface in client.Interfaces)
            {

                Wlan.WlanBssEntry[] wlanBssEntries = wlanIface.GetNetworkBssList();

                foreach (Wlan.WlanBssEntry network in wlanBssEntries)
                {
                    int rss = network.rssi;
                    //     MessageBox.Show(rss.ToString());
                    byte[] macAddr = network.dot11Bssid;

                    string tMac = &amp;quot;&amp;quot;;

                    for (int i = 0; i &amp;lt; macAddr.Length; i++)
                    {

                        tMac += macAddr[i].ToString(&amp;quot;x2&amp;quot;).PadLeft(2, '0').ToUpper();

                    }



                    Console.WriteLine(&amp;quot;Found network with SSID {0}.&amp;quot;, System.Text.ASCIIEncoding.ASCII.GetString(network.dot11Ssid.SSID).ToString());

                    Console.WriteLine(&amp;quot;Signal: {0}%.&amp;quot;, network.linkQuality);

                    Console.WriteLine(&amp;quot;BSS Type: {0}.&amp;quot;, network.dot11BssType);

                    Console.WriteLine(&amp;quot;MAC: {0}.&amp;quot;, tMac);

                    Console.WriteLine(&amp;quot;RSSID:{0}&amp;quot;, rss.ToString());


                }
                Console.ReadLine();
            }
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>activex</author><pubDate>Fri, 19 Apr 2013 14:23:06 GMT</pubDate><guid isPermaLink="false">New Post: How to get accesspoint IP address? 20130419022306P</guid></item><item><title>New Post: The network connection profile is corrupted</title><link>http://managedwifi.codeplex.com/discussions/404651</link><description>&lt;div style="line-height: normal;"&gt;What's interesting to me is that Microsoft does not include the hex element in their profiles that they create for connections, nor do they have it in any of their samples.  So if I just use the profile that's already on the system, it may throw the error.  Easy to put in a try/catch, but still...&lt;br /&gt;
&lt;br /&gt;
I actually posted because I noticed that you have &amp;lt;authenticate&amp;gt; set to WPAPSK for both WPA and WPAPSK profiles.  Looking at Microsoft's samples, it's hard to tell what they are using as WPA and what is WPAPSK.  it looks like their WPA-Personal is shared key, and Enterprise is not?  (cf &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa369853(v=vs.85).aspx" rel="nofollow"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/aa369853(v=vs.85).aspx&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
Anyone know how to map the dot11DefaultAuthAlgorithm enum to those samples?&lt;br /&gt;
&lt;/div&gt;</description><author>pointtx</author><pubDate>Tue, 09 Apr 2013 11:19:55 GMT</pubDate><guid isPermaLink="false">New Post: The network connection profile is corrupted 20130409111955A</guid></item><item><title>New Post: Find the MAC of current AP</title><link>http://managedwifi.codeplex.com/discussions/431933</link><description>&lt;div style="line-height: normal;"&gt;I found a couple ways to do it.  The first one is using Managed WIFI. &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;'Make sure you add a reference to the ManagedWifi.dll
Imports NativeWifi
Imports System.Text
Public Class Form1
    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        ApInfo()
    End Sub
    Private Sub ApInfo()
        'This string will contain the AP's SSID.
        Dim ApSSID As String = &amp;quot;&amp;quot;
        Dim client As New WlanClient()
        For Each wlanIface As WlanClient.WlanInterface In client.Interfaces
            Dim networks As Wlan.WlanAvailableNetwork() = wlanIface.GetAvailableNetworkList(0)
            For Each network As Wlan.WlanAvailableNetwork In networks
                'This check to see if the network is connected. If it is then it grabs the SSID.
                If network.flags = 3 Then
                    ApSSID = GetStringForSSID(network.dot11Ssid)
                    'Put the value in a textbox.
                    txtSSID.AppendText(ApSSID &amp;amp; vbCrLf)
                End If
            Next

            Dim wlanBssEntries As Wlan.WlanBssEntry() = wlanIface.GetNetworkBssList()
            'Now you can find the AP Mac then cross reference it to the SSID pulled earlier.
            For Each network2 As Wlan.WlanBssEntry In wlanBssEntries
                Dim macAddr As Byte() = network2.dot11Bssid
                Dim tMac As String = &amp;quot;&amp;quot;
                'If the SSID's match then output the result to a textbox.
                If GetStringForSSID(network2.dot11Ssid) = ApSSID Then
                    For i As Integer = 0 To macAddr.Length - 1
                        tMac += macAddr(i).ToString(&amp;quot;x2&amp;quot;).PadLeft(2, &amp;quot;0&amp;quot;c).ToUpper()
                    Next
                    txtApMAC.AppendText(tMac &amp;amp; vbCrLf)
                End If
            Next
        Next
    End Sub
'Used to convert the SSID to the proper format.
    Private Shared Function GetStringForSSID(ByVal ssid As Wlan.Dot11Ssid) As String
        Return Encoding.ASCII.GetString(ssid.SSID, 0, CInt(ssid.SSIDLength))
    End Function
End Class&lt;/code&gt;&lt;/pre&gt;

The other way I found was using NetSH.  You can grab the output of NetSH then reformat the output to get you what you want.  &lt;br /&gt;
&lt;pre&gt;&lt;code&gt; Dim p = New Process()
p.StartInfo.FileName = &amp;quot;cmd.exe&amp;quot;
p.StartInfo.Arguments = (&amp;quot;/c netsh.exe wlan show interfaces | find &amp;quot; &amp;amp; Chr(34) &amp;amp; &amp;quot;BSSID&amp;quot; &amp;amp; Chr(34)) 'parameters.ToString()
p.StartInfo.UseShellExecute = False
p.StartInfo.CreateNoWindow = True
p.StartInfo.RedirectStandardOutput = True
p.Start()
p.WaitForExit(30000)
strCurrentAP = p.StandardOutput.ReadToEnd()
strCurrentAP = (strCurrentAP.Substring(29))&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>ho0k3r</author><pubDate>Mon, 04 Mar 2013 18:08:23 GMT</pubDate><guid isPermaLink="false">New Post: Find the MAC of current AP 20130304060823P</guid></item><item><title>New Post: Qos and WPS</title><link>http://managedwifi.codeplex.com/discussions/435113</link><description>&lt;div style="line-height: normal;"&gt;How can I get an information about state of Qos and WPS of network? &lt;br /&gt;
&lt;/div&gt;</description><author>SageDruid</author><pubDate>Sat, 02 Mar 2013 13:00:42 GMT</pubDate><guid isPermaLink="false">New Post: Qos and WPS 20130302010042P</guid></item><item><title>New Post: Find the MAC of current AP</title><link>http://managedwifi.codeplex.com/discussions/431933</link><description>&lt;div style="line-height: normal;"&gt;I need to do the EXACT same thing (which is a big deal because it seems like no one else in the world needs to do this).&lt;br /&gt;
&lt;br /&gt;
Were you ever able to figure anything out about this?  Are you still working on it/interested in a solution?&lt;br /&gt;
&lt;br /&gt;
Can anyone who knows this API well, just say if it is even possible (through this api) to find the BSSID/mac of the specific layer 2 WAP that you are connected to the SSID through?&lt;br /&gt;
&lt;/div&gt;</description><author>apokkalyps</author><pubDate>Thu, 28 Feb 2013 18:03:23 GMT</pubDate><guid isPermaLink="false">New Post: Find the MAC of current AP 20130228060323P</guid></item><item><title>New Post: The network connection profile is corrupted</title><link>http://managedwifi.codeplex.com/discussions/404651</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;You forget the &amp;lt;hex&amp;gt;&amp;lt;/hex&amp;gt; of the SSID in the SSID-Tag.&lt;/p&gt;
&lt;p&gt;&amp;lt;SSIDConfig&amp;gt;&lt;br /&gt;
&amp;lt;SSID&amp;gt;&lt;br /&gt;
&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;lt;hex&amp;gt;{x}&amp;lt;/hex&amp;gt;&lt;br /&gt;
&amp;lt;/SSID&amp;gt;&lt;br /&gt;
&amp;lt;/SSIDConfig&amp;gt;&lt;/p&gt;
&lt;p&gt;You must convert the SSID-name to HEX.&lt;/p&gt;
&lt;p&gt;Then it should be working.&lt;/p&gt;
&lt;p&gt;greetz&lt;/p&gt;
&lt;/div&gt;</description><author>dieselmeister</author><pubDate>Wed, 06 Feb 2013 10:59:41 GMT</pubDate><guid isPermaLink="false">New Post: The network connection profile is corrupted 20130206105941A</guid></item><item><title>New Post: Find the MAC of current AP</title><link>http://managedwifi.codeplex.com/discussions/431933</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I'm trying to find the MAC of my currently connected AP.  I'm working on a program that will show the current AP MAC while roaming from AP to AP.&lt;/p&gt;
&lt;p&gt;I found this example to get the MAC of all AP's visible but I don't understand how to specify only the AP I am connected to.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://managedwifi.codeplex.com/discussions/398107" rel="nofollow"&gt;http://managedwifi.codeplex.com/discussions/398107&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I hope someone can help.&lt;/p&gt;
&lt;p&gt;Using VB.NET.   But C# is ok too.&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;/div&gt;</description><author>ho0k3r</author><pubDate>Mon, 04 Feb 2013 20:54:34 GMT</pubDate><guid isPermaLink="false">New Post: Find the MAC of current AP 20130204085434P</guid></item><item><title>New Post: How set "Connect even if the network is not broadcasting its name (SSID)" profile properties?</title><link>http://managedwifi.codeplex.com/discussions/430791</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;when I click on profile properties, check-box for &amp;quot;Connect even if the network is not broadcasting its name (SSID)&amp;quot;, how that check-box selects automatically with &amp;quot;SetProfile() and Connect() commands?.&lt;/p&gt;
&lt;/div&gt;</description><author>tvnaidu</author><pubDate>Thu, 24 Jan 2013 21:43:23 GMT</pubDate><guid isPermaLink="false">New Post: How set "Connect even if the network is not broadcasting its name (SSID)" profile properties? 20130124094323P</guid></item><item><title>New Post: After reboot, couldnot connect to hidden WiFi Network, why?</title><link>http://managedwifi.codeplex.com/discussions/430755</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;after I reboot unit, it is not connect automatically to hidden Wifi network, any idea?&lt;/p&gt;
&lt;/div&gt;</description><author>tvnaidu</author><pubDate>Thu, 24 Jan 2013 17:14:11 GMT</pubDate><guid isPermaLink="false">New Post: After reboot, couldnot connect to hidden WiFi Network, why? 20130124051411P</guid></item><item><title>New Post: WlanConnectionNotification doesn't get fired occasionally</title><link>http://managedwifi.codeplex.com/discussions/429726</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Obviously i wasn't thinking clearly when i was coding this. The issue is the local scope of my WlanClient client. Fixed it by making it a global var and only instantiate it once. /facepalm&lt;/p&gt;
&lt;/div&gt;</description><author>ataro</author><pubDate>Wed, 16 Jan 2013 16:59:44 GMT</pubDate><guid isPermaLink="false">New Post: WlanConnectionNotification doesn't get fired occasionally 20130116045944P</guid></item><item><title>New Post: WlanConnectionNotification doesn't get fired occasionally</title><link>http://managedwifi.codeplex.com/discussions/429726</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;just a quick note that i tested this by connecting/disconnecting the wifi connection many times and try to observe the notification. I notice that after the initial missed notification, i can't receive any further notification at all even if i continue to
 connect/disconnect the wifi connection. It's confusing because this code does work most of the time.&lt;/p&gt;
&lt;/div&gt;</description><author>ataro</author><pubDate>Tue, 15 Jan 2013 23:58:00 GMT</pubDate><guid isPermaLink="false">New Post: WlanConnectionNotification doesn't get fired occasionally 20130115115800P</guid></item><item><title>New Post: WlanConnectionNotification doesn't get fired occasionally</title><link>http://managedwifi.codeplex.com/discussions/429726</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;I'm really new to C# and i have found this API to be really helpful. I have the following code to listen to the wifi connect/disconnect events.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; wlanConnectionChangeHandler(Wlan.WlanNotificationData notifyData, Wlan.WlanConnectionNotificationData connNotifyData){
            &lt;span style="color:blue"&gt;string&lt;/span&gt; msg = String.Empty;

            &lt;span style="color:blue"&gt;switch&lt;/span&gt; (notifyData.notificationSource)
            {
                &lt;span style="color:blue"&gt;case&lt;/span&gt; Wlan.WlanNotificationSource.ACM:

                    &lt;span style="color:blue"&gt;switch&lt;/span&gt; ((Wlan.WlanNotificationCodeAcm)notifyData.notificationCode)
                    {
                        &lt;span style="color:blue"&gt;case&lt;/span&gt; Wlan.WlanNotificationCodeAcm.ConnectionStart:
                            msg = &lt;span style="color:#a31515"&gt;&amp;quot;ConnectionStart&amp;quot;&lt;/span&gt;;
                            &lt;span style="color:blue"&gt;break&lt;/span&gt;;

                        &lt;span style="color:blue"&gt;case&lt;/span&gt; Wlan.WlanNotificationCodeAcm.ConnectionComplete:
                                msg = &lt;span style="color:#a31515"&gt;&amp;quot;ConnectionComplete&amp;quot;&lt;/span&gt;;
                                WlanClient client = &lt;span style="color:blue"&gt;new&lt;/span&gt; WlanClient();
                                &lt;span style="color:blue"&gt;foreach&lt;/span&gt; (WlanClient.WlanInterface wlanIface &lt;span style="color:blue"&gt;in&lt;/span&gt; client.Interfaces)
                                {
                                    Wlan.WlanAssociationAttributes conAttributes = wlanIface.CurrentConnection.wlanAssociationAttributes;
                                    Wlan.Dot11Ssid ssid = conAttributes.dot11Ssid;
                                    PhysicalAddress bssid = conAttributes.Dot11Bssid;
                                    &lt;span style="color:blue"&gt;int&lt;/span&gt; rssi = wlanIface.RSSI;

                                    msg &amp;#43;= &lt;span style="color:#a31515"&gt;&amp;quot;. ssid: &amp;quot;&lt;/span&gt; &amp;#43; GetStringForSSID(ssid) &amp;#43; &lt;span style="color:#a31515"&gt;&amp;quot;. rssi: &amp;quot;&lt;/span&gt; &amp;#43; rssi.ToString() &amp;#43; &lt;span style="color:#a31515"&gt;&amp;quot;. MAC: &amp;quot;&lt;/span&gt; &amp;#43; bssid.ToString();
                                    &lt;span style="color:blue"&gt;break&lt;/span&gt;;
                                }

                            &lt;span style="color:blue"&gt;break&lt;/span&gt;;

                        &lt;span style="color:blue"&gt;case&lt;/span&gt; Wlan.WlanNotificationCodeAcm.Disconnecting:
                            msg = &lt;span style="color:#a31515"&gt;&amp;quot;Disconnecting&amp;quot;&lt;/span&gt;;
                            &lt;span style="color:blue"&gt;break&lt;/span&gt;;

                        &lt;span style="color:blue"&gt;case&lt;/span&gt; Wlan.WlanNotificationCodeAcm.Disconnected:
                            msg = &lt;span style="color:#a31515"&gt;&amp;quot;Disconnected&amp;quot;&lt;/span&gt;;
                            &lt;span style="color:blue"&gt;break&lt;/span&gt;;

                        &lt;span style="color:blue"&gt;default&lt;/span&gt;:
                            msg = &lt;span style="color:#a31515"&gt;&amp;quot;unknown notificationCode =&amp;quot;&lt;/span&gt; &amp;#43; notifyData.notificationCode;
                            &lt;span style="color:blue"&gt;break&lt;/span&gt;;

                    }
                    MessageBox.Show(msg &amp;#43; &lt;span style="color:#a31515"&gt;&amp;quot; for profile:&amp;quot;&lt;/span&gt; &amp;#43; connNotifyData.profileName);
                    &lt;span style="color:blue"&gt;break&lt;/span&gt;;

                &lt;span style="color:blue"&gt;default&lt;/span&gt;:
                    &lt;span style="color:green"&gt;//MessageBox.Show(&amp;quot;irrelevant notification. Ignore&amp;quot;);&lt;/span&gt;
                    &lt;span style="color:blue"&gt;break&lt;/span&gt;;
            }
        }

        &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;string&lt;/span&gt; GetStringForSSID(Wlan.Dot11Ssid ssid)
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; Encoding.ASCII.GetString( ssid.SSID, 0, (&lt;span style="color:blue"&gt;int&lt;/span&gt;) ssid.SSIDLength );
        }

        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; registerWlanListener()
        {
            WlanClient client = &lt;span style="color:blue"&gt;new&lt;/span&gt; WlanClient();

            &lt;span style="color:blue"&gt;foreach&lt;/span&gt; (WlanClient.WlanInterface wlanIface &lt;span style="color:blue"&gt;in&lt;/span&gt; client.Interfaces)
            {
                &lt;span style="color:blue"&gt;string&lt;/span&gt; str = &lt;span style="color:#a31515"&gt;&amp;quot;Name=&amp;quot;&lt;/span&gt; &amp;#43; wlanIface.InterfaceName &amp;#43; &lt;span style="color:#a31515"&gt;&amp;quot;. State: &amp;quot;&lt;/span&gt;;

                &lt;span style="color:blue"&gt;switch&lt;/span&gt; (wlanIface.InterfaceState)
                {
                    &lt;span style="color:blue"&gt;case&lt;/span&gt; Wlan.WlanInterfaceState.NotReady:
                        str &amp;#43;= &lt;span style="color:#a31515"&gt;&amp;quot;NotReady&amp;quot;&lt;/span&gt;;
                        &lt;span style="color:blue"&gt;break&lt;/span&gt;;

                    &lt;span style="color:blue"&gt;case&lt;/span&gt; Wlan.WlanInterfaceState.Disconnected:
                        str &amp;#43;= &lt;span style="color:#a31515"&gt;&amp;quot;Disconnected&amp;quot;&lt;/span&gt;;
                        &lt;span style="color:blue"&gt;break&lt;/span&gt;;

                    &lt;span style="color:blue"&gt;case&lt;/span&gt; Wlan.WlanInterfaceState.Disconnecting:
                        str &amp;#43;= &lt;span style="color:#a31515"&gt;&amp;quot;Disconnecting&amp;quot;&lt;/span&gt;;
                        &lt;span style="color:blue"&gt;break&lt;/span&gt;;

                    &lt;span style="color:blue"&gt;case&lt;/span&gt; Wlan.WlanInterfaceState.Connected:
                        str &amp;#43;= &lt;span style="color:#a31515"&gt;&amp;quot;Connected&amp;quot;&lt;/span&gt;;
                        &lt;span style="color:blue"&gt;break&lt;/span&gt;;
                }

                wlanIface.WlanConnectionNotification &amp;#43;= wlanConnectionChangeHandler;
                MessageBox.Show(str &amp;#43; &lt;span style="color:#a31515"&gt;&amp;quot;. Listener registered&amp;quot;&lt;/span&gt;);
            }
        }

        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; unregisterWlanListener()
        {
            WlanClient client = &lt;span style="color:blue"&gt;new&lt;/span&gt; WlanClient();

            &lt;span style="color:blue"&gt;foreach&lt;/span&gt; (WlanClient.WlanInterface wlanIface &lt;span style="color:blue"&gt;in&lt;/span&gt; client.Interfaces)
            {
                wlanIface.WlanConnectionNotification -= wlanConnectionChangeHandler;
                MessageBox.Show(wlanIface.InterfaceName &amp;#43; &lt;span style="color:#a31515"&gt;&amp;quot;. Listener unregistered&amp;quot;&lt;/span&gt;);
            }
        }

&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;At the start, i call registerWlanListener, and before stopping my app, i call unregisterWlanListener(). I've tested my desktop app on win7 as well as win8 tablet, and have the following issues on both:&lt;/p&gt;
&lt;p&gt;1. Most of the time, my wlanConnectionChangeHandler gets called on the wifi connect/disconnect and everything works fine. However, on some occasion, it doesn't get called at all. What can lead to this?&lt;/p&gt;
&lt;p&gt;2. On separate occasions, even though I've removed the event handler, i've still received notifications. Am I missing something in removing these event handler?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;/div&gt;</description><author>ataro</author><pubDate>Tue, 15 Jan 2013 23:47:00 GMT</pubDate><guid isPermaLink="false">New Post: WlanConnectionNotification doesn't get fired occasionally 20130115114700P</guid></item><item><title>New Post: The network connection profile is corrupted</title><link>http://managedwifi.codeplex.com/discussions/404651</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;I have been running into this same issue. &amp;nbsp;No matter what I do, I always get the corrupted profile error. &amp;nbsp;I have been swallowing this exception and using the event handler (wlanIface_WlanConnectionNotification) to report success and failure based on the&amp;nbsp;Wlan.WlanNotificationCodeAcm
 objects that come back.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Even if the Corrupt profile exception occurs I am still seeing a successful connection.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However when i give the Connect method a bad passPhrase my application seems to crash unexpectedly even if I swallow all System.Exceptions. &amp;nbsp;Not quite sure why.&lt;/p&gt;
&lt;/div&gt;</description><author>brianthesmith</author><pubDate>Thu, 29 Nov 2012 15:45:29 GMT</pubDate><guid isPermaLink="false">New Post: The network connection profile is corrupted 20121129034529P</guid></item><item><title>New Post: The network connection profile is corrupted</title><link>http://managedwifi.codeplex.com/discussions/404651</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Whenever I am trying to connect to a network with WPA2PSK security with TKIP/AES Encryption I am getting &amp;quot;The network connection profile is corrupted&amp;quot;. Below is the profilexml I am using.&lt;/p&gt;
&lt;p&gt;profileXml = &lt;span style="color:blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#a31515"&gt;&amp;quot;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot; ?&amp;gt;&amp;lt;WLANProfile xmlns=\&amp;quot;http://www.microsoft.com/networking/WLAN/profile/v1\&amp;quot;&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;SSIDConfig&amp;gt;&amp;lt;SSID&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;/SSID&amp;gt;&amp;lt;/SSIDConfig&amp;gt;&amp;lt;connectionType&amp;gt;ESS&amp;lt;/connectionType&amp;gt;&amp;lt;connectionMode&amp;gt;auto&amp;lt;/connectionMode&amp;gt;&amp;lt;autoSwitch&amp;gt;false&amp;lt;/autoSwitch&amp;gt;&amp;lt;MSM&amp;gt;&amp;lt;security&amp;gt;&amp;lt;authEncryption&amp;gt;&amp;lt;authentication&amp;gt;WPA2PSK&amp;lt;/authentication&amp;gt;&amp;lt;encryption&amp;gt;TKIP&amp;lt;/encryption&amp;gt;&amp;lt;useOneX&amp;gt;false&amp;lt;/useOneX&amp;gt;&amp;lt;/authEncryption&amp;gt;&amp;lt;sharedKey&amp;gt;&amp;lt;keyType&amp;gt;passPhrase&amp;lt;/keyType&amp;gt;&amp;lt;protected&amp;gt;true&amp;lt;/protected&amp;gt;&amp;lt;keyMaterial&amp;gt;{1}&amp;lt;/keyMaterial&amp;gt;&amp;lt;/sharedKey&amp;gt;&amp;lt;/security&amp;gt;&amp;lt;/MSM&amp;gt;&amp;lt;/WLANProfile&amp;gt;&amp;quot;&lt;/span&gt;,
 profileName, key);&lt;/p&gt;
&lt;p&gt;Can any one please suggest what am I doing wrong. Below is the complete function.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; Wifi_SetProfile(&lt;span style="color:blue"&gt;string&lt;/span&gt; profileargs, &lt;span style="color:blue"&gt;string&lt;/span&gt; keyargs)
        {
            &lt;span style="color:green"&gt;// Connects to a known network with WEP security&lt;/span&gt;
            &lt;span style="color:blue"&gt;string&lt;/span&gt; profileName = profileargs; &lt;span style="color:green"&gt;// this is also the SSID&lt;/span&gt;
            &lt;span style="color:blue"&gt;string&lt;/span&gt; key = keyargs;

            WlanClient client = &lt;span style="color:blue"&gt;new&lt;/span&gt; WlanClient();
            &lt;span style="color:blue"&gt;foreach&lt;/span&gt; (WlanClient.WlanInterface wlanIface &lt;span style="color:blue"&gt;in&lt;/span&gt; client.Interfaces)
            {
                &lt;span style="color:green"&gt;// Connects to a known network with WEP security&lt;/span&gt;
				&lt;span style="color:blue"&gt;string&lt;/span&gt; profileXml = &lt;span style="color:blue"&gt;string&lt;/span&gt;.Empty;
				Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0);
				&lt;span style="color:blue"&gt;foreach&lt;/span&gt; (Wlan.WlanAvailableNetwork network &lt;span style="color:blue"&gt;in&lt;/span&gt; networks)
				{
					&lt;span style="color:blue"&gt;if&lt;/span&gt; (profileargs == GetStringForSSID(network.dot11Ssid))
					{
						&lt;span style="color:blue"&gt;string&lt;/span&gt; name = GetStringForSSID(network.dot11Ssid); &lt;span style="color:green"&gt;// this is typically the network's SSID&lt;/span&gt;

						&lt;span style="color:blue"&gt;if&lt;/span&gt; (network.dot11DefaultAuthAlgorithm == Wlan.Dot11AuthAlgorithm.IEEE80211_Open)
						{
							profileXml = &lt;span style="color:blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#a31515"&gt;&amp;quot;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot;?&amp;gt;&amp;lt;WLANProfile xmlns=\&amp;quot;http://www.microsoft.com/networking/WLAN/profile/v1\&amp;quot;&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;SSIDConfig&amp;gt;&amp;lt;SSID&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;/SSID&amp;gt;&amp;lt;/SSIDConfig&amp;gt;&amp;lt;connectionType&amp;gt;ESS&amp;lt;/connectionType&amp;gt;&amp;lt;MSM&amp;gt;&amp;lt;security&amp;gt;&amp;lt;authEncryption&amp;gt;&amp;lt;authentication&amp;gt;open&amp;lt;/authentication&amp;gt;&amp;lt;encryption&amp;gt;None&amp;lt;/encryption&amp;gt;&amp;lt;useOneX&amp;gt;false&amp;lt;/useOneX&amp;gt;&amp;lt;/authEncryption&amp;gt;&amp;lt;/security&amp;gt;&amp;lt;/MSM&amp;gt;&amp;lt;/WLANProfile&amp;gt;&amp;quot;&lt;/span&gt;, profileName, key);
							&lt;span style="color:blue"&gt;break&lt;/span&gt;;
						}
						&lt;span style="color:blue"&gt;if&lt;/span&gt; (network.dot11DefaultAuthAlgorithm == Wlan.Dot11AuthAlgorithm.RSNA_PSK)
						{
							&lt;span style="color:green"&gt;//doesnot used shared key on this profile xml which will prompt user to add the key to connect&lt;/span&gt;
							profileXml = &lt;span style="color:blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#a31515"&gt;&amp;quot;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot; ?&amp;gt;&amp;lt;WLANProfile xmlns=\&amp;quot;http://www.microsoft.com/networking/WLAN/profile/v1\&amp;quot;&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;SSIDConfig&amp;gt;&amp;lt;SSID&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;/SSID&amp;gt;&amp;lt;/SSIDConfig&amp;gt;&amp;lt;connectionType&amp;gt;ESS&amp;lt;/connectionType&amp;gt;&amp;lt;connectionMode&amp;gt;auto&amp;lt;/connectionMode&amp;gt;&amp;lt;autoSwitch&amp;gt;false&amp;lt;/autoSwitch&amp;gt;&amp;lt;MSM&amp;gt;&amp;lt;security&amp;gt;&amp;lt;authEncryption&amp;gt;&amp;lt;authentication&amp;gt;WPA2PSK&amp;lt;/authentication&amp;gt;&amp;lt;encryption&amp;gt;TKIP&amp;lt;/encryption&amp;gt;&amp;lt;useOneX&amp;gt;false&amp;lt;/useOneX&amp;gt;&amp;lt;/authEncryption&amp;gt;&amp;lt;sharedKey&amp;gt;&amp;lt;keyType&amp;gt;passPhrase&amp;lt;/keyType&amp;gt;&amp;lt;protected&amp;gt;true&amp;lt;/protected&amp;gt;&amp;lt;keyMaterial&amp;gt;{1}&amp;lt;/keyMaterial&amp;gt;&amp;lt;/sharedKey&amp;gt;&amp;lt;/security&amp;gt;&amp;lt;/MSM&amp;gt;&amp;lt;/WLANProfile&amp;gt;&amp;quot;&lt;/span&gt;, profileName, key);
							&lt;span style="color:blue"&gt;break&lt;/span&gt;;
						}
						&lt;span style="color:blue"&gt;if&lt;/span&gt; (network.dot11DefaultAuthAlgorithm == Wlan.Dot11AuthAlgorithm.WPA)
						{
							profileXml = &lt;span style="color:blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#a31515"&gt;&amp;quot;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot;?&amp;gt;&amp;lt;WLANProfile xmlns=\&amp;quot;http://www.microsoft.com/networking/WLAN/profile/v1\&amp;quot;&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;SSIDConfig&amp;gt;&amp;lt;SSID&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;/SSID&amp;gt;&amp;lt;/SSIDConfig&amp;gt;&amp;lt;connectionType&amp;gt;ESS&amp;lt;/connectionType&amp;gt;&amp;lt;connectionMode&amp;gt;auto&amp;lt;/connectionMode&amp;gt;&amp;lt;autoSwitch&amp;gt;false&amp;lt;/autoSwitch&amp;gt;&amp;lt;MSM&amp;gt;&amp;lt;security&amp;gt;&amp;lt;authEncryption&amp;gt;&amp;lt;authentication&amp;gt;WPAPSK&amp;lt;/authentication&amp;gt;&amp;lt;encryption&amp;gt;TKIP&amp;lt;/encryption&amp;gt;&amp;lt;useOneX&amp;gt;false&amp;lt;/useOneX&amp;gt;&amp;lt;/authEncryption&amp;gt;&amp;lt;sharedKey&amp;gt;&amp;lt;keyType&amp;gt;passPhrase&amp;lt;/keyType&amp;gt;&amp;lt;protected&amp;gt;true&amp;lt;/protected&amp;gt;&amp;lt;keyMaterial&amp;gt;{1}&amp;lt;/keyMaterial&amp;gt;&amp;lt;/sharedKey&amp;gt;&amp;lt;/security&amp;gt;&amp;lt;/MSM&amp;gt;&amp;lt;/WLANProfile&amp;gt;&amp;quot;&lt;/span&gt;, profileName, key);
							&lt;span style="color:blue"&gt;break&lt;/span&gt;;
						}
						&lt;span style="color:blue"&gt;if&lt;/span&gt; (network.dot11DefaultAuthAlgorithm == Wlan.Dot11AuthAlgorithm.WPA_PSK)
						{
							profileXml = &lt;span style="color:blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#a31515"&gt;&amp;quot;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot; ?&amp;gt;&amp;lt;WLANProfile xmlns=\&amp;quot;http://www.microsoft.com/networking/WLAN/profile/v1\&amp;quot;&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;SSIDConfig&amp;gt;&amp;lt;SSID&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;/SSID&amp;gt;&amp;lt;/SSIDConfig&amp;gt;&amp;lt;connectionType&amp;gt;ESS&amp;lt;/connectionType&amp;gt;&amp;lt;connectionMode&amp;gt;auto&amp;lt;/connectionMode&amp;gt;&amp;lt;autoSwitch&amp;gt;false&amp;lt;/autoSwitch&amp;gt;&amp;lt;MSM&amp;gt;&amp;lt;security&amp;gt;&amp;lt;authEncryption&amp;gt;&amp;lt;authentication&amp;gt;WPAPSK&amp;lt;/authentication&amp;gt;&amp;lt;encryption&amp;gt;TKIP&amp;lt;/encryption&amp;gt;&amp;lt;useOneX&amp;gt;false&amp;lt;/useOneX&amp;gt;&amp;lt;/authEncryption&amp;gt;&amp;lt;sharedKey&amp;gt;&amp;lt;keyType&amp;gt;passPhrase&amp;lt;/keyType&amp;gt;&amp;lt;protected&amp;gt;true&amp;lt;/protected&amp;gt;&amp;lt;keyMaterial&amp;gt;{1}&amp;lt;/keyMaterial&amp;gt;&amp;lt;/sharedKey&amp;gt;&amp;lt;/security&amp;gt;&amp;lt;/MSM&amp;gt;&amp;lt;/WLANProfile&amp;gt;&amp;quot;&lt;/span&gt;, profileName, key);
							&lt;span style="color:blue"&gt;break&lt;/span&gt;;
						}

					}
				}

				&lt;span style="color:green"&gt;//makes sure you do not replace the saved profile&lt;/span&gt;
				&lt;span style="color:blue"&gt;foreach&lt;/span&gt; (Wlan.WlanProfileInfo profileInfo &lt;span style="color:blue"&gt;in&lt;/span&gt; wlanIface.GetProfiles())
				{
					&lt;span style="color:blue"&gt;string&lt;/span&gt; profilename = profileInfo.profileName;
					&lt;span style="color:blue"&gt;if&lt;/span&gt; (profileargs == profilename)
					{
						&lt;span style="color:blue"&gt;try&lt;/span&gt;
						{
							profileXml = wlanIface.GetProfileXml(profileInfo.profileName);
							wlanIface.SetProfile(Wlan.WlanProfileFlags.AllUser, profileXml, &lt;span style="color:blue"&gt;false&lt;/span&gt;);
							wlanIface.Connect(Wlan.WlanConnectionMode.Profile, Wlan.Dot11BssType.Any, profileName);

							&lt;span style="color:green"&gt;//Send Message to Update View&lt;/span&gt;
							NetworkParameters param = &lt;span style="color:blue"&gt;new&lt;/span&gt; NetworkParameters();
							param.isConnected = &lt;span style="color:blue"&gt;true&lt;/span&gt;;
							param.connectionString = profileInfo.profileName;
							&lt;span style="color:blue"&gt;var&lt;/span&gt; genericmessage = &lt;span style="color:blue"&gt;new&lt;/span&gt; GenericMessage&amp;lt;NetworkParameters&amp;gt;(&lt;span style="color:blue"&gt;this&lt;/span&gt;, param);
							Messenger.Default.Send(genericmessage);
							btnCancel.RaiseEvent(&lt;span style="color:blue"&gt;new&lt;/span&gt; RoutedEventArgs(Button.ClickEvent));
							&lt;span style="color:blue"&gt;return&lt;/span&gt;;
						}
						&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
						{
							MessageBox.Show(ex.Message);
						}
					}
				}

				&lt;span style="color:blue"&gt;try&lt;/span&gt;
				{
					wlanIface.SetProfile(Wlan.WlanProfileFlags.AllUser, profileXml, &lt;span style="color:blue"&gt;true&lt;/span&gt;);
					wlanIface.Connect(Wlan.WlanConnectionMode.Profile, Wlan.Dot11BssType.Any, profileName);
					&lt;span style="color:green"&gt;//Send Message to Update View&lt;/span&gt;
					NetworkParameters param = &lt;span style="color:blue"&gt;new&lt;/span&gt; NetworkParameters();
					param.isConnected = &lt;span style="color:blue"&gt;true&lt;/span&gt;;
					param.connectionString = profileargs;
					&lt;span style="color:blue"&gt;var&lt;/span&gt; genericmessage = &lt;span style="color:blue"&gt;new&lt;/span&gt; GenericMessage&amp;lt;NetworkParameters&amp;gt;(&lt;span style="color:blue"&gt;this&lt;/span&gt;, param);
					Messenger.Default.Send(genericmessage);
					btnCancel.RaiseEvent(&lt;span style="color:blue"&gt;new&lt;/span&gt; RoutedEventArgs(Button.ClickEvent));
				}
				&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
				{
					MessageBox.Show(ex.Message);
				}
               
            }
        }
        
	}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;</description><author>bishwash</author><pubDate>Mon, 26 Nov 2012 21:51:43 GMT</pubDate><guid isPermaLink="false">New Post: The network connection profile is corrupted 20121126095143P</guid></item><item><title>New Post: InterfaceState.Connected not being set?</title><link>http://managedwifi.codeplex.com/discussions/64349</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;may be try this&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;try&lt;/span&gt;
{
	WlanClient client = &lt;span style="color:blue"&gt;new&lt;/span&gt; WlanClient();
	&lt;span style="color:blue"&gt;foreach&lt;/span&gt; (WlanClient.WlanInterface wlanIface &lt;span style="color:blue"&gt;in&lt;/span&gt; client.Interfaces)
	{
		&lt;span style="color:green"&gt;// Lists all networks with WEP security&lt;/span&gt;
		Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0);
		&lt;span style="color:blue"&gt;foreach&lt;/span&gt; (Wlan.WlanAvailableNetwork network &lt;span style="color:blue"&gt;in&lt;/span&gt; networks)
		{
			&lt;span style="color:blue"&gt;if&lt;/span&gt; ((network.flags &amp; Wlan.WlanAvailableNetworkFlags.Connected) == Wlan.WlanAvailableNetworkFlags.Connected){
			&lt;span style="white-space:pre"&gt;	&lt;/span&gt;CurrentlyConnectedNetwork = GetStringForSSID(network.dot11Ssid);
				IsConnected = &lt;span style="color:blue"&gt;true&lt;/span&gt;;
			}
		}
				
	}

}

&lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception ex)
{

}
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;</description><author>bishwash</author><pubDate>Mon, 26 Nov 2012 21:44:11 GMT</pubDate><guid isPermaLink="false">New Post: InterfaceState.Connected not being set? 20121126094411P</guid></item><item><title>New Post: Recieving System.DllNotFoundException When Trying To Instantiate WlanClient</title><link>http://managedwifi.codeplex.com/discussions/403857</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;So far I've been able to use the ManagedWifi dll for most applications. However this time I'm attempting to run a test application that utilizes the DLL on Win Server 2008.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The application is a WPF app that is being deployed to clients, but we occasionally will pull it up on the server to check a few of the reports.&lt;/p&gt;
&lt;p&gt;Anyways, it's working for all clients. But anytime it's brought up on the server it crashes with this error:&lt;/p&gt;
&lt;p&gt;Framework Version: v4.0.30319Description: The process was terminated due to an unhandled exception.&lt;/p&gt;
&lt;p&gt;Exception Info: System.DllNotFoundExceptionStack:&amp;nbsp; &amp;nbsp;at NativeWifi.Wlan.WlanCloseHandle(IntPtr, IntPtr)&amp;nbsp; &amp;nbsp;at NativeWifi.WlanClient.Finalize()&lt;/p&gt;
&lt;p&gt;I've tried catching and handling the error, but it seems to be&amp;nbsp;occurring&amp;nbsp;somewhere within the DLL and it's not being forwarded to my application. Anyone have any suggestions on how to solve this issue? I&amp;quot;m guessing there's a required DLL that's
 missing in Server 2008 R2.&lt;/p&gt;
&lt;/div&gt;</description><author>Philter</author><pubDate>Mon, 19 Nov 2012 21:04:04 GMT</pubDate><guid isPermaLink="false">New Post: Recieving System.DllNotFoundException When Trying To Instantiate WlanClient 20121119090404P</guid></item><item><title>New Post: windows service: still doesn't work</title><link>http://managedwifi.codeplex.com/discussions/400483</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;I saw someone posted this earlier, but didn't get any resolution.&amp;nbsp; Getting&lt;/p&gt;
&lt;p&gt;&amp;quot;Attempted to read or write protected memory.&amp;nbsp; This is often an indication that other memory is corrupt&amp;quot;&lt;/p&gt;
&lt;p&gt;When built as release and running as a service.&amp;nbsp; Works fine as debug.&lt;/p&gt;
&lt;p&gt;I've used the latest build.&lt;/p&gt;
&lt;/div&gt;</description><author>rjadrian</author><pubDate>Tue, 23 Oct 2012 15:50:26 GMT</pubDate><guid isPermaLink="false">New Post: windows service: still doesn't work 20121023035026P</guid></item><item><title>New Post: Latest version 41381</title><link>http://managedwifi.codeplex.com/discussions/389629</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Indeed. :-)&lt;/p&gt;&lt;/div&gt;</description><author>ikonst</author><pubDate>Fri, 19 Oct 2012 18:18:25 GMT</pubDate><guid isPermaLink="false">New Post: Latest version 41381 20121019061825P</guid></item><item><title>New Post: How can i check connection status? </title><link>http://managedwifi.codeplex.com/discussions/398107</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hello, i'm looking for an answer, how can I get connection status?&lt;/p&gt;
&lt;p&gt;I have some network, and i'm trying to connect with it. I need connection status for example if password was good then connected, if not then something else. Someone know how can i do that?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; button1_Click(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, EventArgs e)
        {
            button3.Visible = &lt;span style="color:blue"&gt;true&lt;/span&gt;;
            button1.Visible = &lt;span style="color:blue"&gt;false&lt;/span&gt;;
            changePos();

            &lt;span style="color:blue"&gt;string&lt;/span&gt; name2;
            WlanClient client = &lt;span style="color:blue"&gt;new&lt;/span&gt; WlanClient();
            &lt;span style="color:blue"&gt;foreach&lt;/span&gt; (WlanClient.WlanInterface wlanIface &lt;span style="color:blue"&gt;in&lt;/span&gt; client.Interfaces)
            {
                Wlan.WlanBssEntry[] wlanBssEntries = wlanIface.GetNetworkBssList();
                &lt;span style="color:blue"&gt;foreach&lt;/span&gt; (Wlan.WlanBssEntry network &lt;span style="color:blue"&gt;in&lt;/span&gt; wlanBssEntries)
                {
                    &lt;span style="color:blue"&gt;byte&lt;/span&gt;[] macAddr = network.dot11Bssid;
                    &lt;span style="color:blue"&gt;string&lt;/span&gt; tMac = &lt;span style="color:#a31515"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;
                    &lt;span style="color:blue"&gt;for&lt;/span&gt; (&lt;span style="color:blue"&gt;int&lt;/span&gt; i = 0; i &amp;lt; macAddr.Length; i&amp;#43;&amp;#43;)
                    {
                        tMac &amp;#43;= macAddr[i].ToString(&lt;span style="color:#a31515"&gt;&amp;quot;x2&amp;quot;&lt;/span&gt;).PadLeft(2, &lt;span style="color:#a31515"&gt;'0'&lt;/span&gt;).ToUpper();
                    }
                    
                    name2 = GetStringForSSID(network.dot11Ssid);
                    &lt;span style="color:blue"&gt;foreach&lt;/span&gt; (Wlan.WlanProfileInfo profileInfo &lt;span style="color:blue"&gt;in&lt;/span&gt; wlanIface.GetProfiles())
                    {
                        &lt;span style="color:blue"&gt;string&lt;/span&gt; name = profileInfo.profileName; &lt;span style="color:green"&gt;// this is typically the network's SSID&lt;/span&gt;
                        &lt;span style="color:blue"&gt;string&lt;/span&gt; xml = wlanIface.GetProfileXml(profileInfo.profileName);
                    }

                    textBox1.AppendText( GetStringForSSID(network.dot11Ssid) &amp;#43; &lt;span style="color:#a31515"&gt;&amp;quot;\r\n&amp;quot;&lt;/span&gt;);
                    textBox2.AppendText( network.linkQuality &amp;#43; &lt;span style="color:#a31515"&gt;&amp;quot;%&amp;quot;&lt;/span&gt; &amp;#43;&lt;span style="color:#a31515"&gt;&amp;quot;\r\n&amp;quot;&lt;/span&gt;);
                    textBox3.AppendText( tMac &amp;#43; &lt;span style="color:#a31515"&gt;&amp;quot;\r\n&amp;quot;&lt;/span&gt;);

                    profileNameList.Add(GetStringForSSID(network.dot11Ssid));
                    macList.Add(tMac); 

                    &lt;span style="color:blue"&gt;if&lt;/span&gt; (name2 == &lt;span style="color:#a31515"&gt;&amp;quot;test&amp;quot;&lt;/span&gt;) &lt;strong&gt;&lt;span style="color:green"&gt;//if network is avalible then i try to connect&lt;/span&gt;&lt;/strong&gt;
                    {
                        &lt;span style="color:blue"&gt;string&lt;/span&gt; profileName = GetStringForSSID(network.dot11Ssid); ; &lt;span style="color:green"&gt;// this is also the SSID&lt;/span&gt;
                        &lt;span style="color:blue"&gt;string&lt;/span&gt; mac = ConvertToHex(profileName).ToUpper();
                        &lt;span style="color:blue"&gt;string&lt;/span&gt; key = &lt;span style="color:#a31515"&gt;&amp;quot;has34&amp;quot;&lt;/span&gt;;
                        &lt;span style="color:blue"&gt;string&lt;/span&gt; profileXml = &lt;span style="color:blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#a31515"&gt;&amp;quot;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot;?&amp;gt;&amp;lt;WLANProfile xmlns=\&amp;quot;http://www.microsoft.com/networking/WLAN/profile/v1\&amp;quot;&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;SSIDConfig&amp;gt;&amp;lt;SSID&amp;gt;&amp;lt;hex&amp;gt;{1}&amp;lt;/hex&amp;gt;&amp;lt;name&amp;gt;{0}&amp;lt;/name&amp;gt;&amp;lt;/SSID&amp;gt;&amp;lt;/SSIDConfig&amp;gt;&amp;lt;connectionType&amp;gt;ESS&amp;lt;/connectionType&amp;gt;&amp;lt;MSM&amp;gt;&amp;lt;security&amp;gt;&amp;lt;authEncryption&amp;gt;&amp;lt;authentication&amp;gt;open&amp;lt;/authentication&amp;gt;&amp;lt;encryption&amp;gt;WEP&amp;lt;/encryption&amp;gt;&amp;lt;useOneX&amp;gt;false&amp;lt;/useOneX&amp;gt;&amp;lt;/authEncryption&amp;gt;&amp;lt;sharedKey&amp;gt;&amp;lt;keyType&amp;gt;networkKey&amp;lt;/keyType&amp;gt;&amp;lt;protected&amp;gt;false&amp;lt;/protected&amp;gt;&amp;lt;keyMaterial&amp;gt;{2}&amp;lt;/keyMaterial&amp;gt;&amp;lt;/sharedKey&amp;gt;&amp;lt;keyIndex&amp;gt;0&amp;lt;/keyIndex&amp;gt;&amp;lt;/security&amp;gt;&amp;lt;/MSM&amp;gt;&amp;lt;/WLANProfile&amp;gt;&amp;quot;&lt;/span&gt;, profileName, mac, key);
                        wlanIface.SetProfile(Wlan.WlanProfileFlags.AllUser, profileXml, &lt;span style="color:blue"&gt;true&lt;/span&gt;);
                        wlanIface.Connect(Wlan.WlanConnectionMode.Profile, Wlan.Dot11BssType.Any, profileName); 
                    } &lt;span style="color:#008000"&gt;&lt;strong&gt;// I NEED STATUS, NEED TO KNOW PASSWORD IS CORRECT OR NOT&lt;/strong&gt;&lt;/span&gt;
                }
            }
        }
&lt;/pre&gt;
&lt;pre&gt;&lt;div style="color:black; background-color:white"&gt;&lt;pre&gt;&lt;span style="color:blue"&gt;&lt;span style="white-space:pre"&gt;	&lt;/span&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;string&lt;/span&gt; GetStringForSSID(Wlan.Dot11Ssid ssid)
        {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; Encoding.ASCII.GetString(ssid.SSID, 0, (&lt;span style="color:blue"&gt;int&lt;/span&gt;)ssid.SSIDLength);
        }

        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;string&lt;/span&gt; ConvertToHex(&lt;span style="color:blue"&gt;string&lt;/span&gt; asciiString)
        {
            &lt;span style="color:blue"&gt;string&lt;/span&gt; hex = &lt;span style="color:#a31515"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;
            &lt;span style="color:blue"&gt;foreach&lt;/span&gt; (&lt;span style="color:blue"&gt;char&lt;/span&gt; c &lt;span style="color:blue"&gt;in&lt;/span&gt; asciiString)
            {
                &lt;span style="color:blue"&gt;int&lt;/span&gt; tmp = c;
                hex &amp;#43;= String.Format(&lt;span style="color:#a31515"&gt;&amp;quot;{0:x2}&amp;quot;&lt;/span&gt;, (&lt;span style="color:blue"&gt;uint&lt;/span&gt;)System.Convert.ToUInt32(tmp.ToString()));
            }
            &lt;span style="color:blue"&gt;return&lt;/span&gt; hex;
        }&lt;/pre&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;br&gt;&lt;/pre&gt;
&lt;pre&gt;Darek Musielak.&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>DarekMusielak</author><pubDate>Thu, 04 Oct 2012 21:34:14 GMT</pubDate><guid isPermaLink="false">New Post: How can i check connection status?  20121004093414P</guid></item></channel></rss>