How to detect from PPC when ActiveSync is connected

  • Thread starter Tihomir Ignatov
  • Start date
T

Tihomir Ignatov

Hello,
How can I detect from my device when Activesync is connected?

Tihomir
 
R

Richard Lewis

Tihomir said:
Hello,
How can I detect from my device when Activesync is connected?

Tihomir

try checking the IP address for PPP_PEER

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;
}
 
R

Robert Levy [MS]

On Windows Mobile 5.0, you can just query the SystemState.CradlePresent
property
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top