첫 번째 변환이 성공하지만 두 번째 변환을 수행하거나 변환 함수를 두 번째로 호출 할 때, 그것은 다음과 같은 예외가 발생하는 과정을 여러 번 시작하는 방법 :여러 작업
비동기 읽기 작업 스트림에서 이미 시작되었습니다 ...
이 기능을 여러 번 변환하는 방법은 무엇입니까? 프로그램을 닫고 다시 시작하면 작동하지만 한 번에 두 번째로 호출하면 작동하지 않습니다.
private void conversion(string cmd)
{
try
{
p = this.process1;
p.StartInfo.FileName = @"C:\ffmpegtool\bin\ffmpeg.exe";
p.StartInfo.Arguments = cmd;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.BeginOutputReadLine();
p.BeginErrorReadLine();
if (p.HasExited)
{
p.CancelErrorRead();
p.CancelOutputRead();
p.Close();
MessageBox.Show("Closed");
}
}
catch (Exception ex)
{
MessageBox.Show("Exception : \n" + ex.Message);
}
}
당신이 더 구체적 일 수 있다면 더 좋습니다. 코드에서 예외가 발생 했습니까? – fruggiero
파일 단위로 파일을로드하는 방법 ... 문제는 파일을 34.mp4를 35.mp3으로 변환한다고 생각합니다.하지만 다른 21.mp4를 22.mp3으로 변환하려고하면 "Async read 작업이 이미 스트림 당신이 제대로에서는 StreamReader를 닫지 않는 것 같다 –
에서 시작됩니다 .. 단지로 교체'using' 문 –