title: C# - Impersonation Issue: Either a required impersonation level was not provided, or the provided impersonation level is invalid
body: <p>Any help on this one would be greatly appreciated.</p>
  
  <p>I have a console app which runs on users PCs. Within the app I want to impersonate an admin account so I can writes files to the users <code>C:\Program Files</code> folder.</p>
  
  <p>When I attempt this I receive the error <strong>"Either a required impersonation level was not provided, or the provided impersonation level is invalid"</strong></p>
  
  <p>I'm using the <code>LogonUser</code> impersonation method where I specify the domain, username &amp; password parameters along with the following:</p>
  
  <pre><code>LogonType set to: const int LOGON32_LOGON_INTERACTIVE = 2;
  LogonProvider set to: const int LOGON32_PROVIDER_DEFAULT = 0;
  </code></pre>
  
  <p>Does anyone know the LogonType &amp; LogonProvider values I must specify to allow me to achieve this?</p>
  
  <p>I have verified that the Admin account I'm using can write to the users <code>C:\Program Files</code> folder so I'm guessing this should be achievable via code also</p>