Help redirecting files as input/output in C#
Posted: Sun Feb 09, 2014 7:28 pm
				
				Alright I am trying to use C# for a school lab. It is either that or use Java like everyone else or learn Ada   
 
But we have to get all input from a text file and output to another text file. In Java, this is as simple as having 2 text files and entering
and then all input comes from the input text file and all output goes to the output text file. 
Looking up the same thing in C#, I can't seem to find how to do this in a simple way. All the .NET options are all giving options using the processes, 40+ lines of code, dozens of objects, and some even using TPL. Just writing the code to expect keyboard input and then piping the file name or trying the Java way doesn't work. Is there a simple way to do this?
EDIT: Oh, and this is just a simple console application with POCOs ("Plain Ol' CLR Objects").
			 
 But we have to get all input from a text file and output to another text file. In Java, this is as simple as having 2 text files and entering
Code: Select all
C:\>java program < input.txt > output.txtLooking up the same thing in C#, I can't seem to find how to do this in a simple way. All the .NET options are all giving options using the processes, 40+ lines of code, dozens of objects, and some even using TPL. Just writing the code to expect keyboard input and then piping the file name or trying the Java way doesn't work. Is there a simple way to do this?
EDIT: Oh, and this is just a simple console application with POCOs ("Plain Ol' CLR Objects").
