Process ofcProcess = new Process(); ofcProcess.StartInfo = new ProcessStartInfo(); ofcProcess.StartInfo.FileName = ofcLocation + @"\ofc.exe"; ofcProcess.StartInfo.WorkingDirectory = ofcLocation; ofcProcess.StartInfo.UseShellExecute = false; ofcProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; ofcProcess.StartInfo.RedirectStandardOutput = true; ofcProcess.Start(); System.IO.StreamReader myOutput = ofcProcess.StandardOutput; string m_output = myOutput.ReadToEnd(); ofcProcess.WaitForExit(); if (ofcProcess.HasExited) { System.Diagnostics.EventLog.WriteEntry("MyEventLog", "OFC.exe output:\r\n" + m_output); } else { System.Diagnostics.EventLog.WriteEntry("MyEventLog", "OFC.exe output:\r\nProcess haven't existed!"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)