views:

179

answers:

1

Hi Guys, I am working on a project to download files using .Net c# 2.0 SP1. One of the requirements of the project is to not seek any proxy details and automatically detect this from IE etc.

Now i haven't worked with proxy before and hence i am a bit baffled. After hours of searching google, msdn etc, i have come across the following article http://msdn.microsoft.com/en-gb/magazine/cc300743.aspx#S3

Now i am totally confused how to do this? Can someone please help me with an easier implementation or guide me please?

Sorry once again if i sound silly, but i haven't worked with .Net proxies and hence I am struggling.

This is for C# Winforms and hence i cannot do this in web.config.

Thanks in advance for your help.

A: 

.NET 2.0 will automatically using the proxy settings from IE by default; however, there is an extra configuration step required to use the default proxy credentials saved in IE. To enable this, ensure that the following section appears in your app.config file:

<configuration>
    <!-- ... -->
    <system.net>
        <defaultProxy useDefaultCredentials="true"/>
    </system.net>

For a full description of the element, see MSDN. For more complicated HTTP Proxy scenarios, see Using HTTP Proxy Servers.

Bradley Grainger
I should have mentioned this that i need to do this for winforms.
Manish
@Manish: app.config *is* WinForms...
Austin Salonen
@Austin My appologies
Manish
PS : Still doesn't resolve the issue
Manish
I am looking for some C# code possible similar to C code here http://stackoverflow.com/questions/202547/how-do-i-find-out-the-browsers-proxy-settings/2238761#2238761
Manish