hi,
check this link
http://www.opennetcf.org/.
There is a library and with it, you can command the GPRS connection.
The code looks like to:
ConnectionManager connMgr = new ConnectionManager(); // open connection manager
public void connectGPRS()
{
DestinationInfoCollection DIC = connMgr.EnumDestinations(); // look the different types of connection
long startTime;
try
{
foreach (DestinationInfo di in DIC)
{
if (di.description == "Internet") // for the connection "Internet" or what you want (it can be "The Internet), it depends on your smartphone
{
connMgr.Connect(di.guid, true, ConnectionMode.Asynchronous); // try to connect
}
If GPRS connection is available and just want to enable from your
application, you can simply open a site from your code so that GPRS
connections will be established.
Here is the code:
public static bool IsWebAccessible() // Call this class as follows: bool bResponse = Net.IsWebAccessible();
{
HttpWebRequest hwrRequest;
HttpWebResponse hwrResponse;
string strUrl = @"http://www.bing.com/";
bool bConnected = false;
try
{
hwrRequest = (HttpWebRequest)WebRequest.Create(strUrl);
hwrResponse = (HttpWebResponse)hwrRequest.GetResponse();
if (hwrResponse.StatusCode == HttpStatusCode.OK)
{
bConnected = true;
}
}
catch (WebException we)
{
bConnected = false;
}
catch (Exception ex)
{
bConnected = false;
}
finally
{
hwrRequest = null;
hwrResponse = null;
}
return bConnected;
}
hope this will help you