I tried all the solutions to the other questions, but none of them worked. I also tried "call filename.exe>log.txt" in CMD, but it didn't work. I'd appreciate it if you could help me with this.
I am a non-English-speaking student, so the expression may be strange. I'd appreciate your understanding.
using (Process process = new Process())
{
process.StartInfo.FileName = ProcessPath;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.WorkingDirectory = Path.GetDirectoryName(ProcessPath);
process.Start();
while (process.HasExited)
{
TextBox1.AppendText(process.StandardOutput.ReadLine()+"\r\n");
}
process.WaitForExit();
}