QUESTION POSED ON: 25 November 2004
I am programming ASPX pages in C# and I want to redirect the result from a created process to a text file, like:
Process myProcess = new Process();
myProcess.StartInfo.FileName = "cmd.exe";
string a = @"/c echo Y| ping www.yahoo.com>d:temp.txt";
myProcess.StartInfo.Arguments = a;
myProcess.StartInfo.UseShellExecute=false;
myProcess.StartInfo.RedirectStandardOutput = true;
myProcess.StartInfo.CreateNoWindow = true ;
myProcess.Start();
But it did not work: nothing was written into the file temp.txt and I did not get any error message. Can you help me to find where the problem is?
|