We use proxy server to connect to internet in office, so I want to Add Proxy information like "Proxy server, port, user name & password" into my Web browser control's code so that this web browser(latest company news) should not give error if the application is accessed on a computer where the internet access is not given to the logged in user.
The WebPermission Class is also not having any kind of help where I can add user name & password inside the code so that the windows form should not give error.
But I'm not able to find any piece of help/code for this purpose.

3 answers
As no one else has answered this question and you've 'bumped' it several times, I'll attempt to do so though I'm not very familiar with the WebBrowser control.
What I do know is that the control is just an IE shell so it won't work at all unless IE is installed on the user's machine. If IE is installed, then the control will simply use IE's registry settings as it doesn't appear to have any properties or methods of its own which can be used to configure it dynamically.
After googling it, I came up with this thread which bears out what I've said above and specifies the registry settings that would need to be changed.
I always found this article (see also Part 2) which shows how you can set the proxy server address and port without changing the registry directly.
However, I don't know how you can automatically supply the correct username and password so, assuming the rest of it works, I think you'll just have to tell the relevant users what these are so they can type them in.
answered 2 years ago by:
17279
412
I have an application which is for sending sms from the desktop and its name is WAY2SMS desktop client. In that application the developer had provided textbox so that the user can provide Proxy details. Sadly debugging.com does not allows sharing of images so I can't share its snapshot at this minute. This means that we can use/include proxy details in the code also. This was the only reason that I wanted to know about this control. I had also came across those articles (registry), an msnd's article on http://msdn.microsoft.com/en-us/library/system.net.webproxy.aspx also made me feel that maybe achieving this task might be possible. But but but.......
WebProxy proxyObject = new WebProxy("http://proxyserver:80/",true);
WebRequest req = WebRequest.Create("http://www.gsvirdi.com");
req.Proxy = proxyObject;
This will help... but the issue remains unanswered.....
I wanted to provide Username & password inside the code. So that those who are not having internet access can also read company's latest news in the windows form.
If I can include this feature then I can get official permission to try-on my hands on development in working hours also. :)
answered 2 years ago by:
412
Well, if it helps, the WebProxy constructor has an overload which allows you to set the username and password:
However, I have no idea how to associate a WebProxy object with the WebBrowser control.
answered 2 years ago by:
17279
412
No errors (pop ups)..... but the browser control does not shows the webpage. The error says: Action canceled. Check if you are connected to internet. or There was no reply from the DNS server.