11.6. Get an HTML Page from a Site That Requires Authentication
Problem
You need to retrieve a file from a web site, but the web site requires that you provide credentials for the purpose of authentication.
Solution
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.
|
Get Visual Basic 2008 Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.