I have a method that is called, although I would like the message box to be shown after the method has been completed (right now the message box is shown straight after the method is called):
if (Check == true)
{
StartConvIpod();
}
else
{
}
MessageBox.Show("Operation Successful!");
StartConvIpod:
private void StartConvIpod()
{
string res = Directory.EnumerateFiles("dump").
OrderBy(x => File.GetCreationTime(x)).Last();
string sub = res.Substring(5);
string sub2 = sub.Substring(0, sub.Length - 4);
Process p = new Process();
p.StartInfo.WorkingDirectory = "dump";
p.StartInfo.FileName = "ffmpeg.exe";
p.StartInfo.Arguments = "-i " + sub + " -f mp4 -vcodec mpeg4 -b 700k -aspect 4:3 -r 23.98 -s 320x240 -acodec ac3 -ar 48000 iPodConversions\\" + sub2 + ".mp4";
p.Start();
}
Use this at the end of your code:
Don’t forget to check its return value to make sure it actually was successful, though: