Solved

Connect with GPRS programatically for Window Mobile 5 C#.NET window application

Posted on 2009-07-09
2
1,634 Views
Last Modified: 2013-12-09
I am developing window mobile application in C#.Net. This mobile window application will connect with MSSQL Server using GPRS.
Problem: My Window mobile Application needs GPRS to be connected. As GPRS is not connected by default.  I am looking for the way where I can first check status of GPRS and then if it is in disconnected mode, i can connect it automatically using code.
0
Comment
Question by:mitsdev
2 Comments
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 500 total points
ID: 24818686
you can use OpenNETCF (www.opennetcf.com) library and its COnnectionManager class. Then when you made a connection, you can receive notifications about connection state changes etc.

to check the connectivity status before you first use above class, you can check something like this (vb.net sample, but easily convertible to c#):

            Try
                Dim hostName As String = System.Net.Dns.GetHostName()
                Dim hostEntry As IPHostEntry = System.Net.Dns.GetHostEntry(hostName)
                Dim hostIPAdd As String = hostEntry.AddressList(0).ToString()
                ret = hostIPAdd <> IPAddress.Parse("127.0.0.1").ToString()
            Catch
                ret = False
            End Try

Microsoft.WindowsMobile.Status.SystemState.ConnectionCount (and other similar properties) may or may not have proper value (as in case when you connected via ActiveSync to the desktop)
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question