Click here to Skip to main content
15,921,694 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am having a small problem creating a web automated tester for my company. I have to use 3 proxy servers of my company to ping main server. All i need to do is set their proxy and browse a page on main server.

I am using vb.net and a web browser control. I am able to change proxy through registry settings but that works only for 1 browser at a time. I mean all 3 will have same proxy. Do you guys know any method by which i can use all 3 different proxies at same time?

I also decided to give httprequests a try. I got a sample code to post data with proxy but how do i browse a page with httprequests ?

Any help would be appreciated.
Posted
Updated 29-Jan-11 20:58pm
v2

1 solution

The WebBrowser control uses the current settings in IE. It IS just an embedded IE control after all. So, the changes you make in IE affect all instances of IE that are running. The same goes for the WebBrowser control.

You can use the HttpWebRequest class, which can take explicit proxy information, and HttpWebResponse classes, to grab the pages you need, then send them to the DocumentText or DocumentStream properties of the WebBrowser object. But, you'll have to manage evaluating all of the links and making additional requests for all the files that make up a single web page, such as images...
 
Share this answer
 
Comments
Espen Harlinn 31-Jan-11 17:04pm    
5+ Good answer, sounds like a bit of work though ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900