【发布时间】:2013-07-14 22:15:30
【问题描述】:
我目前正在尝试通过命令提示符进行基本的 mysqlcheck。 mysql.exe 文件本身位于工作目录指向的 bin 中,可通过 cmd 用作命令的一部分。
现在我在打开外壳时卡住了它停止的位置。它不会继续启动标准输入。
{
Process proc = new Process();
proc.StartInfo.FileName = Path.Combine(Environment.SystemDirectory, "cmd.exe");
proc.StartInfo.WorkingDirectory = @"C:\Program Files (x86)\MySQL\bin";
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.Arguments = @"Mysqlcheck -u root -c -ppassword database";
proc.Start();
string output = proc.StandardOutput.ReadToEnd();
proc.StandardInput.WriteLine("Mysqlcheck -u root -c -ppassword database");
proc.WaitForExit();
}
【问题讨论】: