title: System.Net.WebClient doesn't work with Windows Authentication
body: <p>I am trying to use System.Net.WebClient in a WinForms application to upload a file to an IIS6 server which has Windows Authentication as
  it only 'Authentication' method.</p>
  
  <pre><code>WebClient myWebClient = new WebClient();
  myWebClient.Credentials = new System.Net.NetworkCredential(@"boxname\peter", "mypassword"); 
  byte[] responseArray = myWebClient.UploadFile("http://localhost/upload.aspx", fileName);
  </code></pre>
  
  <p>I get a 'The remote server returned an error: (401) Unauthorized', actually it is a 401.2</p>
  
  <p>Both client and IIS are on the same Windows Server 2003 Dev machine.</p>
  
  <p>When I try to open the page in Firefox and enter the same correct credentials as in the code, the page comes up.
  However when using IE8, I get the same 401.2 error.</p>
  
  <p>Tried Chrome and Opera and they both work.</p>
  
  <p>I have 'Enable Integrated Windows Authentication' enabled in the IE Internet options.</p>
  
  <p>The Security Event Log has a Failure Audit:</p>
  
  <pre><code>Logon Failure:
      Reason:     An error occurred during logon
      User Name:  peter
      Domain:     boxname
      Logon Type: 3
      Logon Process:  ÈùÄ
      Authentication Package: NTLM
      Workstation Name:   boxname
      Status code:    0xC000006D
      Substatus code: 0x0
      Caller User Name:   -
      Caller Domain:  -
      Caller Logon ID:    -
      Caller Process ID:  -
      Transited Services: -
      Source Network Address: 127.0.0.1
      Source Port:    1476
  </code></pre>
  
  <p>I used Process Monitor and Fiddler to investigate but to no avail.</p>
  
  <p>Why would this work for 3rd party browsers but not with IE or System.Net.WebClient?</p>