Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 929903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:14:52+00:00 2026-05-15T20:14:52+00:00

I have a WM 6.1 Prof. application that checks updates when user wishes to

  • 0

I have a WM 6.1 Prof. application that checks updates when user wishes to do so.

I want to check if there is any avaliable connection (GPRS or Wifi) before it attempts to connect to server.

I am also using openNETCF.NET dll here is what I have done but it doesn’t work everytime,

also I am not sure which type of connection should I use and so.

Ok do you think is this good?

Thank you very much!

  private static HttpWebRequest ConnectWeb(string urlx)
  {

      try
      {
          HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(urlx));

          request.ContentType = @"application/octet-stream";
          request.Credentials = CredentialCache.DefaultCredentials;
          request.Timeout(6000);
          return request;
      }
      catch (Exception ex)
      {
          MessageBox.Show(Lang.CONNECTIONPROBLEM);
          return null;
      }
  }


    private bool downloadTest()
    {

        Stream stream;
        HttpWebResponse response;
        HttpWebRequest request = ConnectWeb(FileManager.url);
        if (request!=null)
        {
            try
            {

                using (response = (HttpWebResponse)request.GetResponse())
                {

                    using (stream = response.GetResponseStream())
                    {
                        byte[] data = ReadFully(stream, (int)response.ContentLength);
                        writeByteArrayToFile(data, "data.zip");                                           
                    }                  
                }

                response.Close();
                stream.Close();

            }
            catch (Exception ex)
            {
                MessageBox.Show(Lang.CONNECTIONPROBLEM);
                return false;
            }

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:14:53+00:00Added an answer on May 15, 2026 at 8:14 pm

    Don’t disconnect your connection manager.

    As soon as you use the Windows Mobile Connection Manager, a plug-in to the network stack (the Autobind Winsock Layered Service Provider) starts automatically binding your network connections to the network interface corresponding to the chosen destination. Basically, it forces the packets to go the right way. If you request a disconnection, it may not send them at all.

    Instead you should call Connect before you try to connect to your update server, then RequestDisconnect once you’re done with it. Use an Asynchronous connection and attach to the Connected event if you want it to work in the background.

    To follow what IE does with choosing the correct destination – WiFi or GPRS – use ConnectionManager.MapUrl to determine the destination GUID, and pass that into Connect. The default mapping behaviour is:

    • If the server-name part of the URL has no dots, it’s a Work address
    • If the server-name part appears in the list of Exceptions, it’s a Work address
    • Otherwise, it’s an Internet address

    What it then does depends on how ActiveSync/Windows Mobile Device Center is set up, if the device is cradled, and what is selected under ‘My network card connects to’, for WiFi (Start > Settings > Connections tab > Network Cards or WiFi icon). If this is set to ‘Work’ and the mapping is ‘The Internet’ it will never use WiFi. If it’s set to ‘The Internet’ it will use WiFi if that is associated and fall back to GPRS if not.

    As I recall, .NET CF’s HttpWebRequest will automatically make use of the Connection Manager, following IE’s behaviour of mapping the destination, so you may not need the OpenNETCF class at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have several 200mb+ files that I want to grep through. How would
I have a silverlight control that has a Frame on it. I want to
Code in inc/q/prof.php: <?php // Insert Comments into Database that user provides $comm =
D6 Prof. We have a special application with a special grid. It have a
I have a two dimensional array that looks like this: TITLETYPE = [['Prof.', '4'],
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
Have a matrix report now that has Position, Hours and Wages for a location
Have you ever obfuscated your code before? Are there ever legitimate reasons to do
On Windows mobile 6.1 prof. I have a messagebox with a yes/no button on
I'm working with Flash Prof. CS 5.5 and have some problems using Textfields, when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.