Using a proxy with a webBrowser in C# IE

ivarga

Junior Member
Joined
Mar 13, 2014
Messages
166
Reaction score
63
Hello ther BHW members!

I am working on a small web browser in C# .NET
And I was wondering.. Could I use two text boxes 1 for the proxy ip and 1 for the port to hook the browser up with a proxy?

If that is possible.. Could someone give me an example on how it would look like? Would be very helpful!
 
hmm, don't really get what you mean. are you using web browser control in C# .net?
but :
textbox? textbox isn't not problem here. just create two textbox, and get those value and put in it
WebProxy() params
like that:

string ip = textbox1.getText();
string port = textbox2. getText();
string proxy = ip + ":" + port;
WebProxy myProxy = new WebProxy(proxy );


then use that web proxy for whatever you want, like:

HttpWebRequest myRequest =(HttpWebRequest)HttpWebRequest.Create("http://www.stackoverflow.com");
myRequest.Proxy = myProxy;
HttpWebResponse myResponse =(HttpWebResponse)myRequest.GetResponse();
 
hmm, don't really get what you mean. are you using web browser control in C# .net?
but :
textbox? textbox isn't not problem here. just create two textbox, and get those value and put in it
WebProxy() params
like that:

string ip = textbox1.getText();
string port = textbox2. getText();
string proxy = ip + ":" + port;
WebProxy myProxy = new WebProxy(proxy );


then use that web proxy for whatever you want, like:

HttpWebRequest myRequest =(HttpWebRequest)HttpWebRequest.Create("http://www.stackoverflow.com");
myRequest.Proxy = myProxy;
HttpWebResponse myResponse =(HttpWebResponse)myRequest.GetResponse();
Would you mind contacting me through Pm? I would appriciate that so much :D
 
Back
Top