title: WebClient DownloadFile throws UnauthorizedAccessException
body: <p>I want to download some files and execute them in the <code>%temp%</code> folder but I get <code>System.UnauthorizedAccessException</code> when I try to run it:</p>
  
  <blockquote>
    <p>Exceção Sem Tratamento: System.Net.WebException: Exceção durante uma
    solicitação do WebClient. ---> System.UnauthorizedAccessException: O
    acesso ao caminho 'C:\Users\Muni\AppData\Local\Temp' foi negado.    em
    System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)<br>
    em System.IO.FileStream.Init(String path, FileMode mode, FileAccess
    access, Int32 rights, Boolean useRights, FileShare share, Int32
    bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
    msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)<br>
    em System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
    access)    em System.Net.WebClient.DownloadFile(Uri address, String
    fileName)    --- Fim do rastreamento de pilha de exceções internas ---
    em System.Net.WebClient.DownloadFile(Uri address, String fileName)<br>
    em System.Net.WebClient.DownloadFile(String address, String fileName) 
    em encrypt.Program.Main(String[] args) na
    C:\Users\Muni\source\repos\encrypt\encrypt\Program.cs</p>
  </blockquote>
  
  <pre><code>         try
          {
              string name = Environment.UserName;
              WebClient Client = new WebClient();
              string temp = "C:\\Users\\" + name + "\\AppData\\Local\\Temp";
              Client.DownloadFile("LINK", temp);
          }
          catch
          {
              return;
          }
  </code></pre>