, cmd.exe, -. , MySQL.exe?
public void Execute() {
Process p = new Process();
p.StartInfo.FileName = @"C:\MySQL\MySQL Server 5.0\bin\mysql.exe";
p.StartInfo.Arguments = String.Format( "-u{0} -p{1}", user, password );
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.Start();
System.IO.StreamWriter SW = p.StandardInput;
System.IO.StreamReader SR = p.StandardOutput;
SW.Close();
}
, / WorkingDirectory...
, : ODBC - API MySQL , mysql.exe ? mysqladmin.exe, mysql.exe ODBC.
cmd.exe, @try @- - - , "" " . :
@"""C:\MySQL\MySQL Server 5.0\bin\mysql.exe"" -uroot -password < ""D:/admindb/AAR12.SQL"""
String.Format(), :
String commandLine = String.Format( @"""{0}"" -u{1} -p{2} < ""{3}""", MySqlCommandPath, DbUid, DbPwd, Path.Combine(Path_Backup, FileName_Backup + ExcID + ".sql"));