Hello,
I want to back up mysql db. For this process, I am using the command below;
-------------
mysqldump -u root -pc111 dbtest db_table_ci > deneme4.sql
-------------
But I want to execute this command from c#. I try the codes below but not working;
-------------
string parametre1 = "mysqldump -u root -pc111 dbtest db_table_ci > deneme4.sql";
Process islem = new Process();
islem.StartInfo.FileName = "C:\\Windows\\System32\\cmd.exe";
islem.StartInfo.Arguments = parametre1;
islem.StartInfo.RedirectStandardOutput = true;
islem.StartInfo.UseShellExecute = false;
islem.Start();
islem.WaitForExit();
string output = islem.StandardOutput.ReadToEnd();
textBox6.Text = output;
-------------
How can I do that?
Regards.
Loading
VulpesPosted Sep 12, 2011, 2:48 PM
VulpesPosted Sep 12, 2011, 6:59 PM
However, if you do use the switch then the prompt is suppressed and the redirection does take place before cmd.exe exits.
It's worth remembering if you do a lot of this kind of stuff.
yokzuPosted Sep 12, 2011, 3:42 PM
But could you please explain that what is the meaning of "/C"? What it changes?
Thanks again.