WiFi & OpenNETCF.Net.NetworkInformation

Last post 01-18-2011 10:07 by daniel.albarracin. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-09-2009 4:50

    WiFi & OpenNETCF.Net.NetworkInformation

    Hi,

    I'm trying to make simple app which should send file to FTP by WiFi or GPRS. I'm using samsung omnia sgh-i900 with WM 6.1. I've written something like this to find adapters and AP:

     foreach (NetworkInterface nil in NetworkInterface.GetAllNetworkInterfaces())
                {
                        cbAdaptersWIFI.Items.Add(nil);
                }

    ....

    wzcni = ((WirelessZeroConfigNetworkInterface)ni);
                    apc = wzcni.NearbyAccessPoints;
                    foreach (OpenNETCF.Net.NetworkInformation.AccessPoint ap in apc)
                    {
                        listaAP.Add(ap.Name);
                    }          

    First Problem -  all found Network Interfaces are Ethernet type I thought that one should be Wireless80211? Second problem is that I have no idea how to connect to specified AP. I don't know if these functions should be used or not: wzcni.Bind() or wzcni.Connect(ap.Name.ToString())?

    Please help how to connect to AP and then how to send file via this AP.

     

  • 01-18-2011 10:07 In reply to

    Re: WiFi & OpenNETCF.Net.NetworkInformation

    Hi, i'm Daniel and i have a question. Do yo know about wifi network connection with addPreferrednetwork method? This is from Opennetcf.Net.NetworkInformation class. I'm making a code to connect my PDA (HP iPAQ 216 Enterprise) with a AP Cisco WAP200. I'm using the follow code on C#:

    addpreferrednetwork("SSID", true, "key", 1, authmode, wepstatus, eapparameters);

    If connec with OpenSystem and WEPEnabled its ok. But if connect with WPA2PSK and AESEnalbed or TKIPEnalbed then i can connect and add networ bat not internet acces.

    Here partial code on C#.

    public void Connecting()

    {

       bool estado;

       INetworkInterface[] allNetworkInterfaces = NetworkInterface.GetAllNetworkInterfaces();

       foreach (NetworkInterface nInterface in allNetworkInterfaces)
       {
           if (nInterface is WirelessZeroConfigNetworkInterface)
           {
             WirelessZeroConfigNetworkInterface interface = (WirelessZeroConfigNetworkInterface)nInterface;
             estado= interface.AddPreferredNetwork("SSID", true, "11111111", 1, AuthenticationMode.WPA2PSK, WEPStatus.AESEnabled, null);


              if (estado)    
              {
                    //Here refence other object

                     objConnect.Connect();
              }
              else
              {
      
              }
         }

    }

    If setting wifi network manually with some date (WPA2, AES, Pass and SSID) then it's ok internet access, but if connecting programatically then no way of internet access. It's ok all setting and authentique SSID but not internet.

    Know Sombody about this? 

    May be error of password? or Encripting?

    Thank you to answer! 

Page 1 of 1 (2 items)