1. If you want to check if the PDA has network connectivity:
public static bool HasNetworkConnectivity()
// Call this class as follows: bool bResponse =
Net.IsWebAccessible;
{
HttpWebRequest hwrRequest;
HttpWebResponse hwrResponse;
string strUrl = @"
http://www.microsoft.com/";
bool bConnected = false;
try
{
hwrRequest = (HttpWebRequest)WebRequest.Create(strUrl);
hwrResponse =
(HttpWebResponse)hwrRequest.GetResponse();
if (hwrResponse.StatusCode == HttpStatusCode.OK)
{
bConnected = true;
}
hwrResponse.GetResponseStream().Close();
}
catch (WebException we)
{
bConnected = false;
}
catch (Exception ex)
{
bConnected = false;
}
finally
{
hwrRequest = null;
hwrResponse = null;
}
return bConnected;
}
Take also a look at ConnectionManager from OpenNETCF. I think it gives
you the ability to enumerate all connections of the device. If you need
that, tell me so that I can show you some code.
Hope it helps.
Regards.