wifi info

  • Thread starter Thread starter merco
  • Start date Start date
M

merco

I'm using .netcf v.20 over a windows 5.0 device (5.1.70).
I want to get some information about wifi using this code:
Public Function GetWLAN(ByVal DiChi As String) As Boolean
Dim ColAd As OpenNETCF.Net.AdapterCollection =
OpenNETCF.Net.Networking.GetAdapters
Dim ColAp As OpenNETCF.Net.AccessPointCollection
Dim a As OpenNETCF.Net.Adapter

For Each a In ColAd
MsgBox(a.Name)
ColAp = Nothing
'ColAp = a.PreferredAccessPoints

'If IsNothing(ColAp) Then
' MsgBox("no acc")
' End If
If a.IsWireless Then
MsgBox("wir")
MsgBox(a.SignalStrength.Decibels.ToString)
Else
MsgBox(a.SignalStrengthInDecibels.ToString)

End If
Next
ColAd = Nothing
a = Nothing

End Function

It seems that a.iswireless is always false, even when i am connected.
a.SignalStrengthInDecibels.ToString has always a value: 0 is the card
is disabled, -50 if the card is enabled.
If i try to get some accesspoint info i get a runtime error...
Some ideas?
thank you
 
This c# code works :

public Adapter getWLanAdapter()
{
AdapterCollection adapterCollection = Networking.GetAdapters();
foreach (Adapter adapter in adapterCollection)
{
if (adapter.IsWireless)
return adapter;
}
return null;
}

It returns the first WLan adapter.

cu
Alex
 
Remember that there's no way for the code to look at the wireless adapter,
as you see it, and recognize it as being a *wireless* adapter. If the
driver for the adapter makes it appear as a wired adapter, as, for example,
the Cisco drivers do when you are using the ACU program from Cisco to
configure the adapter settings, it's doesn't appear wireless. What adapter
are you using and is it set up to use Windows Zero Config to configure its
wireless settings. If it is, I've never seen IsWireless return false.

Paul T.
 
Back
Top