CodePudding user response:
The console program:using System;
using System.IO;
The namespace ConsoleApp1
{
Class Program
{
The static void Main (string [] args)
{
//read
The string content=File. ReadAllText (" d: \ \ 1. TXT ");
//output
Console. WriteLine (content);
//save
File. WriteAllText (" d: \ \ 2. TXT ", content);
The Console. The Read ();
}
}
}
CodePudding user response:
You can also try StreamReader and StreamWriterCodePudding user response: