Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2009-07-09
2
1,638 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
For Sennheiser, comfort, quality and security are high priority areas. This paper addresses the security of Bluetooth technology and the supplementary security that Sennheiser’s Contact Center and Office (CC&O) headsets provide.  
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.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

839 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