none
Window Mobile 5.0 locale problem in developing .Net application RRS feed

  • 問題

  • I have got a .Net program run in PocketPC 2003 SE absolutely no problem in different locale.
    Once I deploy it into WM 5.0, I got exception in reading http://....xml ,
    but it works fine in other language.

    This problem only occurs in China-related city locale. Other locale even greek also works fine in .net 1.0 and 2.0 WM 5.0.

    The code are below,
                HttpWebRequest req = null;
                HttpWebResponse resp = null;
                FileStream str = null;
                Stream respStream = null;
                BinaryReader binReader = null;
                BinaryWriter binWriter = null;
                int bytesRead = 0;
                byte[] buffer = new byte[1024];
               
                    if (File.Exists(SaveTO) == true)
                    {
                        File.Delete(SaveTO);
                    }
                    req = (HttpWebRequest)HttpWebRequest.Create("http://www.xxx.xml");

    -->                resp = (HttpWebResponse)req.GetResponse();
    (Debugger points out that "resp" is null)

                    if (resp.StatusCode == HttpStatusCode.OK)
                    {
                        str = new FileStream(SaveTO, FileMode.Create);
                        respStream = resp.GetResponseStream();
                        binReader = new BinaryReader(respStream, System.Text.Encoding.Default);
                        binWriter = new BinaryWriter(str);

                        do
                        {
                            bytesRead = binReader.Read(buffer, 0, buffer.Length);
                            binWriter.Write(buffer, 0, buffer.Length);
                        }
                        while (bytesRead > 0);

                        binReader.Close();
                        binWriter.Close();
                        str.Close();
                    }

    I am wondering it dod not connect to the destination. as I check the log record in IIS, it did not update. However, my PPC can access internet throught GPRS to browse webpage.
    Thanks for all your help.
    2006年7月14日 上午 02:11

解答

  • I have no idea how it could happen. However, some suggestions for you.

    You may try to deploy your application to PPC2003 Emulator in VS 2005, and see if the problem can be reproduced.
    If it still occurs, then it could be the .NET CF or Windows Mobile problem.
    If not, then try to deploy the same application to another PPC 2003 device...
    If it works fine in different device, then it could be the OEM problem.

    2006年7月24日 上午 11:42
  • Please upgrade your CE-Star to 2.8 R2. The latest version fixed this issue.
    2006年8月10日 下午 05:09

所有回覆

  • Hi, Kangaroo_Marco

    I wonder if you have found your answer.

    However, I didn't see anything weird in your code.
    You said "This problem only occurs in China-related city locale",
    but I am not sure what do you mean...

    Do you change the regional setting of your WM5 device to China cities ?
    Or you got a Chinese version of WM5 device ?

    2006年7月21日 下午 07:33
  • Hi,

           First, thanks for your reply. I have already changed the olcale. The major problem is. When I use English and all the Euro locale, my program works fine. However, when I change to the Chinese regional setting. My PPC is a English machine with CE-Star 2.8 installed.

     

    Bests Marco

    2006年7月24日 上午 01:37
  • I have no idea how it could happen. However, some suggestions for you.

    You may try to deploy your application to PPC2003 Emulator in VS 2005, and see if the problem can be reproduced.
    If it still occurs, then it could be the .NET CF or Windows Mobile problem.
    If not, then try to deploy the same application to another PPC 2003 device...
    If it works fine in different device, then it could be the OEM problem.

    2006年7月24日 上午 11:42
  • Please upgrade your CE-Star to 2.8 R2. The latest version fixed this issue.
    2006年8月10日 下午 05:09