title: How do I download a file by doing a webClient.DownloadFile() which requires a password?
body: <p>The following code is not working because it downloads the actual log-in page of the URL. Yes, the text boxes for username/password. They come down as an .xls file. It's not downloading the actual file. If I go the URL myself, it DOES download the Excel file to my computer. PLEASE NOTE - When I click on the URL, it asks for my credentials.</p>
  
  <pre><code>private void btnGet_Click(object sender, EventArgs e)
  {
      using (WebClient client = new WebClient()) 
      {
          client.Credentials = new NetworkCredential("username", "password");
          client.DownloadFile("longLink", @"C:\Report.xls");
       }
  }
  </code></pre>
  
  <p>Do I need to maybe provide a header with a session ID??</p>