Load web browser with web response
I am working in an application that creates online accounts(Let suppose Gmail) When user run application i navigate the WebBrowser control to Url.User fill the registration form and complete the registration. It is working fine up to here. Now user want to use proxy to access that site. What I want user sets proxy in another form and when he runs application his request is automatically handled by that proxy. One solution is that I first navigate to proxy and then user enter his website and then navigate through that proxy server. But I want that user dose not see proxy server web page and only sees the desire page accessed through proxy.
I read in a post that use WebRequest
class to navigate to web site and set the proxy of my
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;
精彩评论