0

I am trying to download a file from a microsoft site, that uses form based logins (microsoft account). How can I do that using WebClient ? The link is something like "http://go.microsoft.com/fwlink/ ....." Thanks

Laerte Junior
  • 244
  • 3
  • 16

1 Answers1

1

You can set credentials to the WebRequest as follows. This post explains how to download the file.

// Create a request for the specified remote file name
WebRequest request = WebRequest.Create(remoteFilename);
if (request != null)
{
    string username = "username";
    string password = "password";
    request.Credentials = new System.Net.NetworkCredential(username, password);
}
Community
  • 1
  • 1
Kurubaran
  • 8,696
  • 5
  • 43
  • 65