title: c# run console application as different user... impersonation
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3936456/process-start-impersonation-problem">Process.Start() impersonation problem</a>  </p>
  </blockquote>
  
  
  
  <p>I am trying to run a console application as a different user in c#, but I am having trouble. Here is part of my code:</p>
  
  <pre><code>public void encryptPGP(string fileName)
  {
      string sCommandLine = "" +
                  "--recipient \"User Name &lt;username@domain.com&gt;\" --encrypt \"" + fileName + "\"";
  
      System.Diagnostics.Process.Start("C:\\Utilities\\GnuPG\\App\\gpg.exe", sCommandLine);
  }
  </code></pre>
  
  <p>... I need to have the C:\Utilities\GnuPG\App\gpg.exe ran by a certain user. How would I add that in?</p>
  
  <p>This will be used in a web application.</p>
  
  <p>Thanks!</p>