I had a .NET app which talk to a FTP server regularly to check for new files.
Sometime, the application runs behind a proxy server. I have implemented with reference to MSDN:
http://msdn.microsoft.com/en-us/library/dkwyc043(v=vs.100).aspx
<system.net>
<defaultProxy>
useDefaultCredentials="true"
<proxy usesystemdefault="true" />
/>
</defaultProxy>
<settings>
<webProxyScript downloadTime="00:00:30" />
</settings>
<system.net>
But in one case, the proxy servers require authentication by user name and password. When I try opening the app, it cannot connect to Internet and the log said "Unable to connect to Internet, server required authentication"
.
How do I configure my .NET 4.0 app to work for all types of proxy servers (sometime authentication required) ?
PS: I read this thread: How should I set the default proxy to use default credentials?, however it mentioned default proxy & default credentials. In my case, the authentication can be in the form of username/password