using System;
using System.IO;
public class MainClass {
public static int Main(string[] args) {
StreamWriter writer = new StreamWriter(args[1]);
Console.SetOut(writer);
Console.SetIn(new StreamReader("c:\\test.txt"));
string line = "asdf";
Console.WriteLine(line);
writer.Close();
StreamWriter standardOutput = new StreamWriter(Console.OpenStandardOutput());
standardOutput.AutoFlush = true;
Console.SetOut(standardOutput);
Console.WriteLine("");
return 0;
}
}
|