Pipe redirection is not related to program specifically.
All pipe "|" (and also "<" ">") do is change the streams of StandardInput and StandardOutput.
If your program uses Console.Read()/Write() then the pipe and redirections will have an effect on your program.
So doing this:
Would fill up the StandardIn stream of you program with the output of "dir/s"
(Use Console.ReadLine() to get it line by line)