Software Development Network>> Visual C#>> Please help !
ProcessStartInfo pi =
pi.WindowStyle = ProcessWindowStyle.Hidden;
pi.RedirectStandardOutput =
pi.UseShellExecute =
Process p = Process.Start(pi);
p.WaitForExit();
p.Start();
TextReader t = p.StandardOutput;
MessageBox.Show(t.ReadToEnd());(sorry for the code being mangled, the forums editor seems to be doing it)
Please help !
speed32
string line = Console.ReadLine();
StreamWriter sw = new StreamWriter(@"c:\log.txt", true);
sw.Write(line);
sw.Close();
This will read a line from the console and writes it to a file called log.txt.
Manni
how about simply redirecting text printed to stdout using '>'
WM_HOPETHISHELPS
thomas woelfer
Amit kr mishra
ProcessStartInfo pi =
new ProcessStartInfo("cmd.exe", "/c dir");pi.WindowStyle = ProcessWindowStyle.Hidden;
pi.RedirectStandardOutput =
true;pi.UseShellExecute =
false;Process p = Process.Start(pi);
p.WaitForExit();
p.Start();
TextReader t = p.StandardOutput;
MessageBox.Show(t.ReadToEnd());
(sorry for the code being mangled, the forums editor seems to be doing it)
mizatch
sarasotamac