用HttpWebRequest请求网址A,A跳转到B。使用HttpWebRequest只能得到A的返回流得不到跳转以后B的HTML。
设置 request.AllowAutoRedirect = true; 也没用。使用WebBrowser控件可以直接获得B的HTML,但是我不想使用控件,只想使用 WebBrowser 的功能Uri u = new Uri("http://www.baidu.com");
WebBrowser wb = new WebBrowser();
wb.Url = u;wb.Url的值是空的。怎么用WebBrowser 发起请求呢??

解决方案 »

  1.   

    wb.Navigate ("http://www.baidu.com");   
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://feiyun0112.cnblogs.com/
      

  2.   


    这个我试了也不行, wb.DocumentText是空的
      

  3.   

    wb.DocumentCompleted +=
            new WebBrowserDocumentCompletedEventHandler(Document);
    private void Document(object sender,
        WebBrowserDocumentCompletedEventArgs e)
    {
    MessageBox.Show (wb.DocumentText);
    }
      

  4.   

    监听 DocumentCompleted 事件