1
我從Load web browser with web response得到了這個。並想知道如何使用此代碼來使用需要用戶名和密碼才能工作的代理。在WebBrowser和WebRequest中使用代理,如何包含用戶名和密碼?
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://example.com");
webRequest.Proxy = new WebProxy(host, port);
HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
Stream receiveStream = response.GetResponseStream();
WebBrowser webBrowser = new WebBrowser();
webBrowser.DocumentStream = receiveStream;