MySql에서 백업을 복원합니다. 그러나 mysql exe는 종료되지 않습니다. 이 내 코드입니다 -C# - 프로세스가 종료되지 않습니다.
public override bool FullRestore(Stream fileStream)
{
try
{
ProcessStartInfo proc = new ProcessStartInfo();
string cmd = string.Format("--database {0} --user={1} --password={2}", config.GetDbName(), config.GetUserName(), config.GetPassword());
proc.FileName = "mysql";
proc.RedirectStandardInput = true;
proc.RedirectStandardOutput = false;
proc.Arguments = cmd;
proc.UseShellExecute = false;
proc.CreateNoWindow = true;
Process p = Process.Start(proc);
Stream stream = p.StandardInput.BaseStream;
Stream file = Utility.ZipNEncrypt.Unzip(fileStream, "XXXXXX");
byte[] bytes = new byte[1024];
for (int count = 0; (count = file.Read(bytes, 0, 1024)) > 0;)
{
stream.Write(bytes, 0, count);
}
stream.Flush();
p.WaitForExit();
file.Close();
return true;
}
catch (Exception e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
return false;
}
}
내 백업 방법은 잘 작동하지만,이 방법은 작동하지 않습니다
제안 (그들은 많은 유사한 차이가있다).?
'while'루프에 대해 가지고있는 점은 무엇입니까? –
나는 매우 편안하다. –
Jayanta : 제목에 "Closed"를 추가하지 말고 대답을 수락하거나 닫기 버튼을 누릅니다. –