I have the following code snippet to invoke on the command line:
p = new Process(); ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = "cmd.exe"; psi.Arguments = "/C " + "type " + "[abc].pdf"; psi.UseShellExecute = false; psi.RedirectStandardInput = false; psi.RedirectStandardOutput = true; psi.CreateNoWindow = true; p.StartInfo = psi; p.EnableRaisingEvents = true; p.Exited += new EventHandler(p_Exited); p.Start(); p.WaitForExit();
Strange When [abc] is a small pdf file (8kb) p_Exited . But when it is a large PDF file (120kb), it is never called. Any clues?
Thanks,
command-line c # process
user124858
source share