Solved

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

Posted on 2009-07-09
2
1,653 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
[X]
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
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

688 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