You need to give the WebClient object the credentials. Something like this…
WebClient client = new WebClient();
client.Credentials = new NetworkCredential("username", "password");
More Related Contents:
- Authenticate and request a user’s timeline with Twitter API 1.1 oAuth
- WebClient accessing page with credentials
- Deciding between HttpClient and WebClient
- How can I strip HTML tags from a string in ASP.NET?
- How to force HTTPS using a web.config file
- How to get the public IP address of a user in C#
- Return View as String in .NET Core
- How to write some data to excel file(.xlsx)
- How to update a claim in ASP.NET Identity?
- Pulling data from a webpage, parsing it for specific pieces, and displaying it
- Characters in string changed after downloading HTML from the internet
- Can you prevent your ASP.NET application from shutting down?
- ASP.NET MVC Razor render without encoding
- Error – is not marked as serializable
- Convert HTML string to image
- How can I pass a username/password in the header to a SOAP WCF Service
- How do i split a String into multiple values?
- Requesting html over https with c# Webclient
- DateTime.Parse(“2012-09-30T23:00:00.0000000Z”) always converts to DateTimeKind.Local
- How can I handle forms authentication timeout exceptions in ASP.NET?
- Recursive TreeView in ASP.NET
- Index (zero based) must be greater than or equal to zero
- Inline code in head tag – ASP.NET
- Get All Web Controls of a Specific Type on a Page
- Full postback triggered by LinkButton inside GridView inside UpdatePanel
- What is the difference between Debug Mode and Release Mode in Visual Studio 2010? [duplicate]
- Accessing controls created dynamically (c#)
- asp.net web service using office 2010 COM
- Bind Dictionary with list in viewmodel to checkboxes
- Opposite of [compare(” “)] data annotation in .net?