Get dailup connection on Pocket PC using C#


I’m straggling to initialize the system dialup connection if the pocket pc is not connected inside my code.

I want to open a connection to the web on my Pocket pc and test the connection then initialize the dailup connection if the device can not connect; how do I go about doing this?
I’m using pocket pc 2002 and C#.

I have used:       MyRequest = WebRequest.Create(“http://.......”)
            MyResponce = MyRequest.GetResponse()
to check if I can open the web page.

I will be very grateful for any help on this subject.  
Who is Participating?
venishjoeConnect With a Mentor Commented:


Hope this helps

deon001Author Commented:
Thank you Vanish, this is a very helpful and interesting article and I think it will come in use someday. I want to use a pre-setup connection setup on the device. By using MyRequest = WebRequest.Create(“http://.......”); MyResponce = MyRequest.GetResponse();
I can make the connection but it uses the default connection (or the last connection you used) on the device I thought that there is a easy way to get a list of the connection that has already been setup and just call it by it setup name or set the default connection inside my project.

Thanks for the help!

rama_krishna580Connect With a Mentor Commented:
try this..

HttpWebRequest request;
HttpWebResponse response;
bool isConnected = false;

  request = (HttpWebRequest)WebRequest.Create(targetAddress);
  response = (HttpWebResponse)request.GetResponse();

  // success?
  if(response.StatusCode == HttpStatusCode.OK)
    isConnected = true;
catch(WebException we)
  isConnected = false;
catch(Exception ex)
  isConnected = false;
return isConnected;

And look at here..

hope this help you..

best of luck..


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.