I want to complete these steps in CMD using C #
1 - CD C: \ MySQL \ MySQL Server 5.0 \ bin
2 - mysqldump -uroot -ppassword sample> d: \ Test \ 222.sql
In manual mode, I get a file called "222.sql"
I use the code below for this, but something is missing .. Nothing happens
public void CreateScript_AAR() { string commandLine = @"CD C:\MySQL\MySQL Server 5.0\bin\mysqldump -uroot -ppassword sample> d:\Test\222.sql"""; System.Diagnostics.ProcessStartInfo PSI = new System.Diagnostics.ProcessStartInfo("cmd.exe"); PSI.RedirectStandardInput = true; PSI.RedirectStandardOutput = true; PSI.RedirectStandardError = true; PSI.UseShellExecute = false; System.Diagnostics.Process p = System.Diagnostics.Process.Start(PSI); System.IO.StreamWriter SW = p.StandardInput; System.IO.StreamReader SR = p.StandardOutput; SW.WriteLine(commandLine); SW.Close(); }
source share