new StreamWriter(@”C:\console.txt”). So you’re writing to console.txt
using (FileStream stream = new FileStream(@”C:\file.txt”, FileMode.Open))
{
using (StreamReader reader = new StreamReader(stream))
So you are reading from file.txt
Since you seat the output stream of the console to be the ‘writer’ streamwriter, you’re essentially writing the console output to the console.txt file. so the output would be the content of the console which is written in the console.txt file by the writer streamwriter, therefore the console.txt file is the final output.
FileNotFoundException
the Console.txt file
Console.txt? Your read from this file, but final output is Debug console.
new StreamWriter(@”C:\console.txt”). So you’re writing to console.txt
using (FileStream stream = new FileStream(@”C:\file.txt”, FileMode.Open))
{
using (StreamReader reader = new StreamReader(stream))
So you are reading from file.txt
Since you seat the output stream of the console to be the ‘writer’ streamwriter, you’re essentially writing the console output to the console.txt file. so the output would be the content of the console which is written in the console.txt file by the writer streamwriter, therefore the console.txt file is the final output.