C# Console.Write print out in text file? -


can make code print out in text file using console.write ?

 console.write(" enter id: ");  int id = int.parse(console.readline());  console.write(" enter name: ");  string name = console.readline();  console.writeline(" thank you! logged in as" +name+ +id); 

please help!

thanks in advance.

i don't know why need write in file in particular case if want console.writeline write in file may use console.setout(sw);

console.writeline("hello world"); filestream fs = new filestream("test.txt", filemode.create); streamwriter sw = new streamwriter(fs); console.setout(sw); console.writeline("hello file"); sw.close(); 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

java - How to create Table using Apache PDFBox -

mpi - Why is MPI_Bsend not returning error even when the buffer is insufficient to accommodate all the messages -