Quote:
Originally Posted by it-iss.com
What does the string cmd contain after it has generated? Do you keep track of the return string from the execution of the command to see if there is a specific error message?
|
Dear Ronan Cashell, Thanks for your reply,here is the complete code please help me.
String path1 = Server.MapPath("BackupFiles/") + path;
StreamReader file = new StreamReader(path1); string cmd = string.Format(@"C:\EXE\mysql.exe -u{0} -p{1} -h{2} {3} < {4} ", '"' + ViewState["user"].ToString() + '"', '"' + ViewState["password"].ToString() + '"', '"' + ViewState["host"].ToString() + '"', '"' + ViewState["dbName"].ToString() + '"', '"' + path1 + '"');
ProcessStartInfo proc = new ProcessStartInfo(@"C:\EXE\mysql.exe", @"/C " + cmd);
proc.Arguments = cmd;
proc.UseShellExecute = false;
string res;
Process p = new Process();
p.StartInfo = proc; p.Start();
res = file.ReadToEnd();
p.WaitForExit();