Web Browser Control in WinForms

Posted by Shabeer50 under C# on 9/21/2010 | Points: 10 | Views : 5350 | Status : [Member] | Replies : 2
I want to navigate to e specified Website or web page with the WebBrowser-Control in Windows Forms. But how to connect through a proxy server ? How to set the proxy server user name,password and port? etc




Responses

Posted by: Santosh.impossible on: 9/22/2010 [Member] Starter | Points: 25

Up
0
Down
Hi,

Please find the following link to know more about the use of navigation to specified website with the web browser control in the window forms:

http://www.c-sharpcorner.com/UploadFile/mahesh/WebBrowserControl11102005042132AM/WebBrowserControl.aspx
http://www.dotnetcurry.com/ShowArticle.aspx?ID=49&AspxAutoDetectCookieSupport=1

and to set the proxy server details please check the sample code below:

WebProxy proxy = new WebProxy("http://proxy:80/", true);
proxy.Credentials = new NetworkCredential("userId", "password", "Domain");
result.Proxy = proxy;
//Set the login details
result.Credentials = GetCredentials();
//Do not keep alive (stateless mode)
result.KeepAlive = false;

for implementing the WebProxy class you have to include using System.Net namespace.

Please let me know if you have any issues.

Thanks & Regards,
Santosh

santosh kumar patro

Shabeer50, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shabeer50 on: 9/27/2010 [Member] Starter | Points: 25

Up
0
Down
Thanks Santhosh.

I refereed your link my questions is different i want to apply proxy settings for my web browser control with a particular request.


Note :-

Web Browser controls is nothing but an instance of IE. And also i don't want to apply proxy settings in registry also.






Shabeer50, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response