11.6. Get an HTML Page from a Site That Requires Authentication
You need to retrieve a file from a web site, but the web site requires that you provide credentials for the purpose of authentication.
Use the System.Net.WebRequest and System.Net.WebResponse classes as described in recipe 11-4. Before making the request, configure the WebRequest.Credentials and WebRequest.Certificates properties with the necessary authentication information.