Overwrite text document with Form Closing event

I'm wondering how to overwrite text document with Form_FormClosing event

After writing of the text file content into the List<string> strList = new List<string>(); with Form_Load event, I keep the file empty while using the program:

 private void Form1_Load(object sender, EventArgs e)
 {
    //Writing to strList from file

    File.WriteAllText(path, String.Empty);  
 }

and with Form_FormClosing event I write edited List content back to the empty file for further load.

 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     foreach (string s in strList) 
     {                      
        using (StreamWriter sw = File.AppendText(path))
            sw.WriteLine(s);
     }
 }

writes well, but this way is no secured in case of abrupt shut down for any other reason.

I need to clear it with Form_FormClosing, not sure why, but this way makes my file empty, as if the process does not have time to write the text from strList before shutting down in the case of cleaning the file into the event:

 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     File.WriteAllText(path, String.Empty);  

     foreach (string s in strList) 
     {                      
        using (StreamWriter sw = File.AppendText(path))
            sw.WriteLine(s);
     }
 }

and then:

Try this method to write all lines:

File.WriteAllLines(path, strList);