xp下process.waitforexit()执行失败
xp下process.waitforexit()执行失败,在线等
winform程序使用process调用命令行安装MySQL,在使用p.WaitForExit(120000)时,win7没有问题。但是xp下没有等待直接执行到下一步了。难道是因为多核的原因?求解答。
Process p = new Process();
p.StartInfo.FileName = " cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
string strOutput = null;
p.StandardInput.WriteLine("msiexec /i mysql-5.5.25-win32.msi /passive");//安装MySQL
p.WaitForExit(120000);//等待上边程序结束
------解决方案--------------------
为什么要用cmd.exe过一手?
Process p = Process.Start("msiexec.exe", " /i mysql-5.5.25-win32.msi /passive");
p.WaitForExit(120000);
winform程序使用process调用命令行安装MySQL,在使用p.WaitForExit(120000)时,win7没有问题。但是xp下没有等待直接执行到下一步了。难道是因为多核的原因?求解答。
Process p = new Process();
p.StartInfo.FileName = " cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
string strOutput = null;
p.StandardInput.WriteLine("msiexec /i mysql-5.5.25-win32.msi /passive");//安装MySQL
p.WaitForExit(120000);//等待上边程序结束
------解决方案--------------------
为什么要用cmd.exe过一手?
Process p = Process.Start("msiexec.exe", " /i mysql-5.5.25-win32.msi /passive");
p.WaitForExit(120000);