title: C# for loop to write line by line
body: <p>I am trying to write one line of text 75 times and increase the number by 1 till it hits the 75 condition. Starting at 2 for a reason. 
  Here's the code</p>
  
  <pre><code>class WriteTextFile
  {
      static void Main()
      {
          string path = "C:\\Users\\Writefile\\test.txt";
          string line;
          int i = 2;
  
          while (i &lt;= 75 )
          {
              line = "Error_Flag = 'FOR_IMPORT' and location_type =   'Home' and batch_num = " + i + "\n";
              System.IO.File.WriteAllText(@path, line);
              i++;
          }
      }
  }
  </code></pre>
  
  <p>With this, it just writes one line with 75 at the end. I want it to write all 74 lines with the same thing, only the number goes up every time. Thanks. </p>