Firing up IE sounds a bit clumsy to me.
You can access a webserver directly from .net. If you use HttpWebRequest, the GPRS connection will also fire up automatically. The C# syntax is more or less this:
String urlString = "www.example.com";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlString );
WebResponse resp = request.GetResponse();
// You will end up here if the server is not responding, or if the GPRS
// connection is not working
A few notes:
Even for an empty page, this will create 4-5 kB of traffic per request.
If you only want to check that the server hardware and operating system is running, you could use some of the more low level networking stuff in System.Net.Sockets to send an UDP packet (works) or perhaps an ICMP Echo Request (not tested). This will create less than 100 bytes of traffic per request. However, this will not fire up the GPRS connection, and it is more difficult to program.
If you debug your application by deploying it to your device from within VS, the network connection will go through ActiveSync, and UDP will not work. This can be very confusing. Unplug the cable, and the network connection will go through GPRS and UDP will work, but you will be unable to debug from the PC.
All of the above relates to a smartphone without WiFi. Especially the GPRS part may be different for a PDA.
Edited by Allan Olesen, 17 July 2006 - 07:21 AM.