Complete the code to check if a file exists at the given path.
bool exists = File.[1]("example.txt");
The File.Exists method checks if the specified file exists and returns a boolean.
Complete the code to read all text from a file into a string.
string content = File.[1]("data.txt");
File.ReadAllText reads the entire content of a text file into a string.
Fix the error in the code to copy a file from source to destination.
File.[1]("source.txt", "dest.txt");
File.Copy copies a file from one path to another.
Fill both blanks to write text to a file, overwriting if it exists.
File.[1]("log.txt", [2]);
File.WriteAllText writes the given string to the file, replacing existing content.
Fill all three blanks to move a file only if it exists.
if (File.[1]("old.txt")) { File.[2]("old.txt", [3]); }
First, File.Exists checks if the file is there. Then File.Move moves it to the new path "new.txt".
