File.WriteAllText Method (System.IO)

Creates a new file, write the contents to the file, and then closes the file. If the target file already exists, it is truncated and overwritten.