There is a code:
do {
Using (Streamwriter File = New Streamwriter ("NEWS.TXT", TRUE))
{
file.writeline ($ "{Console.ReadLine ()}");
}
} While (Console.ReadLine ()! = "");
You need to implement the entry in news.txt
one line from the console before the user will skip the string by pressing ENTER. This method writes for some reason not all lines, namely, misses each second
Answer 1, Authority 100%
Request for reading and waiting for input is performed with any CONSOLE.REDLINE ()
call. In your case, the problem here:
While (Console.ReadLine ()! = “”);
This entered string will not be recorded.
Code Change Easy:
string newsline;
Using (Streamwriter File = New Streamwriter ("NEWS.TXT", TRUE))
{
do.
{
Newsline = Console.ReadLine ();
File.Writeline (Newsline);
}
While (Newsline! = "");
}