in questo articolo msdn http://msdn.microsoft.com/en-us/library/aa446491.aspx spiega come utilizzare OpenNetCF che appunto è una libreria che permette di valutare il segnale wifi del poket
ad esempio:
#Region "wifiUtility"
Dim signal As New List(Of WIFIStatus)
Dim sig As New WIFIStatus
Private m_adapters As OpenNETCF.Net.AdapterCollection
Private m_nearbyAPs As OpenNETCF.Net.AccessPointCollection
Public Function UpdateAdapter() As List(Of WIFIStatus)
signal.Clear()
m_adapters = Networking.GetAdapters()
For Each ad As Adapter In m_adapters
m_nearbyAPs = ad.NearbyAccessPoints
Dim c As Integer = m_nearbyAPs.Count
Dim conn(c, 3) As String
For Each ap As AccessPoint In m_nearbyAPs
sig = New WIFIStatus
sig.Nome = ap.Name
sig.Decibel = ap.SignalStrength.Decibels
sig.Signal = ap.SignalStrength.ToString()
signal.Add(sig)
Next
Next
Return signal
End Function
#End Region
dove wifistatus è una classe descritta come:
Public Class WIFIStatus
Private _name, _signal As String
Private _decibel As Integer
Public Property Nome() As String
Get
Return _name
End Get
Set(ByVal value As String)
_name = value
End Set
End Property
Public Property Decibel() As Integer
Get
Return _decibel
End Get
Set(ByVal value As Integer)
_decibel = value
End Set
End Property
Public Property Signal() As String
Get
Return _signal
End Get
Set(ByVal value As String)
_signal = value
End Set
End Property
Public Enum WiFiStatus
_ON
OFF
Unknow
End Enum
End Class
dopo di chè ti basta controllare se un wifistatus in signal ha un valore della proprietà "Decibel" maggiore di un tuo valore accettabile ( nel mio caso ho utilizzato -70dB) e sai se il poket è connesso decentemente con wifi o no...
per quanto riguarda l'attivazione o spegnimento della wifi dipende molto dal tuo dispositivo, io usavo un iPaq200 dell'hp e ho usato una dll fatta apposta per questa famiglia di dispositivi
Ciao.
Nicolas
http://perledinico.blogspot.com