title: C# File Handling: Create file in directory where executable exists
body: <p>I am creating a standalone application that will be distributed to many users. Now each may place the executable in different places on their machines.<br>
  I wish to create a new file in the directory from where the executable was executed. So, if the user has his executable in :</p>
  
  <pre><code>C:\exefile\
  </code></pre>
  
  <p>The file is created there, however if the user stores the executable in:</p>
  
  <pre><code>C:\Users\%Username%\files\
  </code></pre>
  
  <p>the new file should be created there.</p>
  
  <p>I do not wish to hard code the path in my application, but identify where the executable exists and create the file in that folder. How can I achieve this?</p>