I am using this to download html content from a site published on IIS:
using (var client = new WebClient())
{
client.Credentials = CredentialCache.DefaultCredentials;
string html = client.DownloadString("http://site.com");
}
But when the IIS is set to Basic Authentication this doesn’t works. The user already type user and password on the IIS dialog box.
There is a way to make this work without pass a user and password again?
Searching more, I found this:
We can get user and password when the IIS is set do basic authentication!