title: File.ReadLines path relative to application executable?
body: <p>I'm reading and writing to some text files and I'm currently using a set path. How can I change that set path to use the same folder where the executable resides?</p>
  
  <p>For example:</p>
  
  <pre><code>File.ReadLines(@"D:\Users\MyUserName\Desktop\MyApplication\names.txt").Skip(1).ToList();
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>File.WriteAllLines(@"D:\Users\MyUserName\Desktop\MyApplication\names.txt", lines);
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>using (StreamWriter writer = new StreamWriter(@"D:\Users\MyUserName\Desktop\MyApplication\names.txt", true))
  {
      writer.WriteLine(myText);
  }
  </code></pre>
  
  <p>It also needs to work when testing in the IDE (Visual Studio).</p>