Jump to content

SmartPhone 2003, ActiveSync and C#


Recommended Posts

Guest Kryptonic
Posted

Hi all,

is it possible, at runtime in a c# .net application running on a mobile device (2003) to check the state of the activesync connection (on the mobile device remember) and if there is no connection attempt to connect it up?

cheers

Will

  • 3 months later...
Posted

think you can do this on AS 4.0 or higher with the API's/SDK

Guest nitramk
Posted (edited)
Hi all,

is it possible, at runtime in a c# .net application running on a mobile device (2003) to check the state of the activesync connection (on the mobile device remember) and if there is no connection attempt to connect it up?

cheers

Will

<{POST_SNAPBACK}>

I've got this code from somewere:

It's a function which returns true if Active Sync is connected. The function simply checks whether the Dns.GetHostEntry("PPP_PEER") not is equal to null and not will throw any exeptions, then the AS is connected.

public bool ActiveSyncConnected()

        {

            bool result = false;

                    try

                    {

                        if (Dns.GetHostEntry("PPP_PEER") != null)

                        {

                            result = true;

                        }

                    }

                    catch { }


            return result;

        }

Edited by nitramk
Posted

that really isnt the correct way of doing it. there maybe another dns hostname as that and not being the mobile device ;)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.