to access the internet I am behind a proxy that requires authentication. I know it's quite simple to pass the network credentials to the proxy like this:
FtpWebRequest request = FtpWebRequest.Create(
new Uri("ftp://upload.myserver.com") as FtpWebRequest;
NetworkCredential credentials = new NetworkCredential("username", "password");
request.Credentials = credentials;
This works!
I also tried to use CredentialCache.DefaultNetworkCredentials
but that doesn't work. I want to avoid storing user name and password anywhere (code, database, config file).
I thought the easiest way would be to use the same dialog that is displayed when I access the internet using Internet Explorer. Does anybody knows how to raise this dialog?
http://services.arcgisonline.com/arcgisexplorer500/help/proxy_connect_to_on_browser_request.png
EDIT
The goal of this task was to upload a file via FTP. Finally I found out that it is not necessary to set a proxy for FTP requests because .NET framework does not allow FTP operation through HTTP proxies. But you have to set the proxy property explicitly to null.
FtpWebRequest request = FtpWebRequest.Create(
new Uri("ftp://upload.myserver.com") as FtpWebRequest;
NetworkCredential credentials = new NetworkCredential("username", "password");
request.Credentials = credentials;
request.Proxy = null;
Thats it!