当前位置:编程学习 > wap >>

使用cmwap,httpwebrequest访问wap网站的问题

使用httpwebrequest取得网页内容,模拟器中没有问题。在手机上使用cmwap连接,访问www网站正常,访问wap网站不能正常取到网页内容。
主要代码

HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(urlText.Text);
            request.Method = "GET";
            request.ContentType = "application/x-www-form-urlencoded";
            request.UserAgent = "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)";
            request.Timeout = 180000;
            request.AddRange(0);
            request.AllowWriteStreamBuffering = true;
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
           
            Stream s = response.GetResponseStream();
            StreamReader sr = new StreamReader(s, System.Text.Encoding.GetEncoding("UTF-8"));
            TextBox1.Text = sr.ReadToEnd();
            
            sr.Close();
            s.Close();


cmwap访问wap网站,取不到网页内容




cmwap访问www网站正常
补充:移动开发 ,  Windows Phone
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,