private static bool IsInCradle()
{
bool result = false;
try
{
// if the device is in the cradle and connected to ActiveSync
// then the desktop computer can be accessed using the hostname
// "PPP_PEER"
IPAddress nullAddress = new IPAddress(0);
IPHostEntry activeSync = Dns.GetHostByName("PPP_PEER");
if(activeSync != null)
{
for(int index=0; index < activeSync.AddressList.Length; index++)
{
if(activeSync.AddressList[index].Address != 0)
{
result = true;
break;
}
}
}
}
catch {}
return result;
}