Home > database >  C # programming
C # programming

Time:09-24

Help write a text file to read and output

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 StreamWriter

CodePudding user response:

refer to the second floor Amon Amon response:
can also try StreamReader and StreamWriter

This can't write, can help me write the bai

CodePudding user response:

No computer, can't write, oneself check online a lot
  • Related