title: Adding a Line to the Middle of a File with .NET
body: <p>Hello I am working on something, and I need to be able to be able to add text into a .txt file. Although I have this completed I have a small problem. I need to write the string in the middle of the file more or less. Example:</p>
  
  <pre><code>Hello my name is Brandon,
  I hope someone can help, //I want the string under this line.
  Thank you.
  </code></pre>
  
  <p>Hopefully someone can help with a solution.</p>
  
  <p><strong>Edit</strong> Alright thanks guys, I'll try to figure it out, probably going to just rewrite the whole file. Ok well the program I am making is related to the hosts file, and not everyone has the same hosts file, so I was wondering if there is a way to read their hosts file, and copy all of it, while adding the string to it?</p>