Connecting using WiFi

Last post 01-16-2012 10:46 by lucacicala. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 01-16-2012 10:46

    Connecting using WiFi

    I'm writing an application to search the AP with the highest strength and then to connect to it.

     After I found the best AP I run following code. It always return true! But every time the current IP is 0.0.0.0 so I suppose no connection is available.

    Where am I wrong?

    OpenNETCF.Net.NetworkInformation.EAPParameters eap = new OpenNETCF.Net.NetworkInformation.EAPParameters();

    eap.Enable8021x = true;

    eap.EapType = EAPType.Default;

    eap.EapFlags = EAPFlags.Enabled;

    bool b = false;

    lock (m_syncRoot)

    {

    b =
    this.wirelessAdapter.AddPreferredNetwork(this.bestAccessPoint.Name, false, passphrase, 1, this.bestAccessPoint.AuthenticationMode, this.bestAccessPoint.Privacy, eap);

    }

     

    if (b)

    {

    lock (m_syncRoot)

    {

    return this.wirelessAdapter.ConnectToPreferredNetwork(this.bestAccessPoint.Name);

    }

    }

    else

    {

    return false;

    }

Page 1 of 1 (1 items)