Using system;using system.collections.generic;using system.linq;using system.text;namespace Test{class Program { static void Main (string[] args) {string path = @ "F:\1.txt";//path of the specified file//--------------- ------------------------------- //. Exists (path) is the determination of whether a file exists under the specified path. if (System.IO.File.Exists (path)) {Console.WriteLine ("file exists under the specified path"); } else {Console.WriteLine ("The file under the specified path does not exist"); }//----------------------------------------------//The "Nike" string is added to the path of "path" in the Encoding.default encoding way to the corresponding file. Note: If F:\1.txt this path does not exist 1.txt this file, it will give you automatically generate a 1.txt file, and then to "Nike" This string added to System.IO.File.AppendAllText (path, "Nike", E Ncoding. Default); Reads the file under path specified by the Encoding.default encoding method. String readFile = System.IO.File.ReadAllText (path, encoding.default); Console.WriteLine (ReadFile); ConsOle. ReadKey (); } }}