Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / January 2006

Tip: Looking for answers? Try searching our database.

Wifi connection programmatically without WZC

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
soilanete - 12 Jan 2006 15:10 GMT
Hi,

We are developing an application with .netcf to connect programatically
with several AP's.
We wan't use the wireless zero configuration dll and we delete the
entry registry value
HKEY_LOCAL_MACHINE->Drivers->BuiltIn->ZeroConfig->Dll

Without delete this key my application works fine because the WZC dll
makes the first bind with an AP and with the latest version of
SetWirelessSettings we can change the SSID.

The problem is when we are trying to connect the first time with the
key HKEY_LOCAL_MACHINE->Drivers->BuiltIn->ZeroConfig->Dll deleted
because we don't have conexion without any AP.

Is posible to do this?
Wich are the steps we need to do a wifi connection without using WZC?
Is necessary use the connectionManager class before use the
SetWirelessSetting method?
How?
Is there any sample code?

Thanks in advance,
<ctacke/> - 12 Jan 2006 15:21 GMT
Why are you deleting the registry key?  WZC is a software interface to the
adapter - without it you have to talk directly with the adapter driver, and
the interface is not standard.

-Chris

> Hi,
>
[quoted text clipped - 20 lines]
>
> Thanks in advance,
soilanete - 12 Jan 2006 16:10 GMT
3 points about my application:

1. I have my application in kiosk mode
2. I wan't notifications popups about available LAN's
3. I need connect with a specific AP between several AP's.

Is possible deactivate WZC popups?

Thanks a lot.
Paul G. Tobey [eMVP] - 12 Jan 2006 16:35 GMT
1. OK
2. You *what* notification popups?  "wan't" isn't a word.  You "want" them
or you "don't want" them?  If "don't want", then disable that feature via
the checkbox for notification of new SSIDs (and figure out where this is
stored by WZC for next time, registry or whatever).
3. You are doing this already, right?  With WZC enabled?  I think it's a
*really* bad, maybe horrible, idea to delete that key.

Paul T.

>3 points about my application:
>
[quoted text clipped - 5 lines]
>
> Thanks a lot.
soilanete - 12 Jan 2006 17:17 GMT
sorry, I´m trying to improve my english.
Thanks a lot.
soilanete - 12 Jan 2006 17:55 GMT
OK, We have now WZC enabled and notifications disabled.
The problem is when we want connect the first time, the code is ...

      private void First_Time()
       {
           TakeConnection();
           OpenNETCF.Net.AdapterCollection oCol =
OpenNETCF.Net.Networking.GetAdapters();
           foreach (OpenNETCF.Net.Adapter a in oCol)
           {
               if (a.IsWireless)
               {
                   a.SetWirelessSettings("PDATeam");
                   a.RebindAdapter();
               }
           }
       }

       private void TakeConnection()
       {
           DestinationInfoCollection oInfo = oCon.EnumDestinations();
           foreach (DestinationInfo d in oInfo)
           {
               bool connected = false;
               if (d.description == "Internet")
               {
                   oCon.Connect();
                   while (!connected)
                   {
                       if (oCon.Status != ConnectionStatus.Connected)
                       {
                           System.Threading.Thread.Sleep(5000);
                           continue;
                       }
                       connected = true;
                   }
               }
           }
       }

The first time, without a previous connection, the var oCon.Status
return "NoPathToDestination" always, but if I stablish a connexion
before starts the program the same var returns "Connected" and in this
case I can use the SetWirelessSettings to set my specifically SSID

Thanks a lot.
Paul G. Tobey [eMVP] - 12 Jan 2006 18:08 GMT
OK, so the problem is one where the Connection Manager is doing something
that you don't expect, not WZC, right?

Paul T.

> OK, We have now WZC enabled and notifications disabled.
> The problem is when we want connect the first time, the code is ...
[quoted text clipped - 42 lines]
>
> Thanks a lot.
soilanete - 12 Jan 2006 19:55 GMT
OK, the problem is the Connection Manager I think, not WZC, but only if
I don't have a previous connection.
Thanks.
Paul G. Tobey [eMVP] - 12 Jan 2006 20:02 GMT
Yes, you might see if there is a method of the connection manager which will
establish a suitable connection and, if there seems not to be one, do that
(I suppose that this might use GPRS, 802.11, etc., whatever seems to it to
be available).  Or, you might try forgetting about connection manager and
just attempt to establish a connection to each of the SSID values that you
know about via the WZC wrapper in OpenNETCF.  I don't do any Pocket PC
programming, so I don't know which is more likely to be the right answer,
maybe someone else can help, but I think that you're on the right track.

Paul T.

> OK, the problem is the Connection Manager I think, not WZC, but only if
> I don't have a previous connection.
> Thanks.
indiekiduk@gmail.com - 13 Jan 2006 15:07 GMT
Looks to me like you are doing things in the wrong order, surely you
should be doing:

private void First_Time()
       {
           OpenNETCF.Net.AdapterCollection oCol =
OpenNETCF.Net.Networking.GetAdapters();
           foreach (OpenNETCF.Net.Adapter a in oCol)
           {
               if (a.IsWireless)
               {
                   a.SetWirelessSettings("PDATeam");
                   a.RebindAdapter();
                   TakeConnection();
               }
           }
       }

i.e. connect to an SSID and wait to see if you get a connection. When
I'm doing this (In StreetHawk
http://www.aspecto-software.com/Streethawk/ ) I dont use the connection
manager at all. I set the SSID and then keep checking my IP address to
see if I have been given one by DHCP, if not I give up and move onto
the next SSID.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.