0
HttpWebRequest myHttpWebRequest1 = (HttpWebRequest)WebRequest.Create("http://www.google.de");
HttpWebResponse myHttpWebResponse1 =(HttpWebResponse)myHttpWebRequest1.GetResponse();
using (Stream stream = myHttpWebResponse1.GetResponseStream())
                {
                    // Get the response stream  
                    StreamReader reader = new StreamReader(stream, Encoding.UTF8);

                    // Read the response into a string 
                    _responseString = reader.ReadToEnd();

                    webBrowser1.DocumentText = _responseString;          
                }

webBrowser1.DocumentText = _responseString;

嘿!在这段代码中,我发送了一个请求,并得到了响应。我将响应读入一个字符串,然后将此字符串分配给 webbrowser 控件。如果我保存响应字符串,我会得到完全相同的站点,但是当我将它分配给 webbrowser 控件时,它看起来会有所不同。

有没有办法将字符串分配给网络浏览器,并显示相同的站点,就像在保存的文件中一样?

4

0 回答 0