It's terribly simple, really.
In the C # code editor, you can:
public static void Main(string[] args) {
Another good idea is to iterate over the args elements in the C # collection so that you can accept multiple files as input. Example: main.exe file1.txt file2.txt file3.txt , etc.
You would do this by modifying the above code using a special for loop, for example:
foreach(string s in args) { using( Streamreader sr = new Streamreader(s) ) { String line = sr.ReadToEnd(); Console.WriteLine(line); } }
Good luck
source share