C
christof
I wish to use an exe file, it looks like this:
System.Diagnostics.Process mysqldump = new System.Diagnostics.Process();
mysqldump.StartInfo.FileName = @"C:\Program Files\MySQL\MySQL
Server 5.0\bin\mysqldump.exe";
Response.Write(File.Exists(mysqldump.StartInfo.FileName).ToString());
//just to check if I'm pointing right
mysqldump.StartInfo.Arguments = @"-u myuser --password=mypass
my5 > F:\\MySQL\\Backup\\my5a";
mysqldump.StartInfo.CreateNoWindow = false;
mysqldump.StartInfo.ErrorDialog = true;
mysqldump.StartInfo.RedirectStandardOutput = true;
mysqldump.StartInfo.UseShellExecute = false;
try
{
Response.Write(mysqldump.Start().ToString());
}
catch (Exception exc)
{
Response.Write(exc.Message);
}
I'm gettin True (file exists) and True (Process.Start()) and no
exception is caught, but there is no effect.
If i simply call in shell:
mysqldump -u myuser --password=mypass my5 > F:\\MySQL\\Backup\\my5a
it works fine, backup is created.
What am I doing wrong?
Thanks a lot
System.Diagnostics.Process mysqldump = new System.Diagnostics.Process();
mysqldump.StartInfo.FileName = @"C:\Program Files\MySQL\MySQL
Server 5.0\bin\mysqldump.exe";
Response.Write(File.Exists(mysqldump.StartInfo.FileName).ToString());
//just to check if I'm pointing right
mysqldump.StartInfo.Arguments = @"-u myuser --password=mypass
my5 > F:\\MySQL\\Backup\\my5a";
mysqldump.StartInfo.CreateNoWindow = false;
mysqldump.StartInfo.ErrorDialog = true;
mysqldump.StartInfo.RedirectStandardOutput = true;
mysqldump.StartInfo.UseShellExecute = false;
try
{
Response.Write(mysqldump.Start().ToString());
}
catch (Exception exc)
{
Response.Write(exc.Message);
}
I'm gettin True (file exists) and True (Process.Start()) and no
exception is caught, but there is no effect.
If i simply call in shell:
mysqldump -u myuser --password=mypass my5 > F:\\MySQL\\Backup\\my5a
it works fine, backup is created.
What am I doing wrong?
Thanks a lot