How to get the error message of a Process?

You need to redirect the standard output or standard error. Here’s a code sample for stdout:

Process p = new Process();
p.StartInfo.FileName = "hello.exe";
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
string stdout = p.StandardOutput.ReadToEnd(); 
p.WaitForExit();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)