ReadAllLines reads all lines of the file into a string array and closes the file.
WriteAllLines creates a new file writes strings to the file and closes the file.
Example:
Replace text line in a file
var lines = File.ReadAllLines(Pathfile);
lines[64] = "new text";
File.WriteAllLines(Pathfile);