用HttpWebRequest 访问页面出现错误:块区长度无效 RRS feed

  • 问题

  • private void button1_Click(object sender, System.EventArgs e)


    string url=@"";


       // Creates an HttpWebRequest with the specified URL.
       HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url );
       // Sends the HttpWebRequest and waits for the response.           
       HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
       // Gets the stream associated with the response.
       Stream receiveStream = myHttpWebResponse.GetResponseStream();
       Encoding encode = System.Text.Encoding.GetEncoding("GB2312");
       // Pipes the stream to a higher level stream reader with the required encoding format.
       StreamReader readStream = new StreamReader( receiveStream, encode );



       // Releases the resources of the Stream.

       // Releases the resources of the response.




    一个托管的IOException 发生在 Appliacation ::Run+0x1a



    2008年3月27日 10:44