How to Know if a Pocket Pc is connected to a Desktop

G

Guest

Hi,
I am Writing an Pocket Pc Application where i need to Transfer some files
from a Desktop to the Device.

Can some one tell me how i can know if the Device is connected to an Desktop
in my Application which is Running on the Pocket PC.

Thanks in Advance,
Bobby
 
N

Nino Benvenuti

D_Guidi said:

No. The OpenNETCF.Desktop.Communication library is for communicating to
the device from the desktop - the OP stated that he wished to ascertain
from the device if it was cradled.

If the device in question is a Windows Mobile 5.0 device, one could
check the Microsoft.WindowsMobile.Status.SystemProperty.CradlePresent
property.

If the device in question is a Windows Mobile 2003 device, one could
check that the name "PPP_PEER" could be resolved on the device. This can
be done either directly in the registry or use the Dns class to try to
resolve the hostname.

You might also want to query the archives of the Pocket PC Developer
group with a search phrase such as "detect cradle" to find additional
alternatives.
http://groups.google.com/group/microsoft.public.pocketpc.developer
 
W

Will Chapman

The following code is part of a routine I use to check whether
the cradled PDA has an internbet connecxtion:
string HostName = Dns.GetHostName();
if (HostName.StartsWith("Pocket")) //obviously you need to use the real device name
{
IPHostEntry thisHost = Dns.GetHostEntry(HostName);
string thisIpAddr = thisHost.AddressList[0].ToString();

ret = thisIpAddr != IPAddress.Parse("127.0.0.1").ToString();

// If true then the emulator is on the cradle/network so check for internet

HTH

Will Chapman
 

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