如题,WaitForExit普通按下面这样写,可是我不创建实例要怎么写呢?
Process p = new Process();
p.StartInfo.FileName = "file.exe";
p.Start();
p.WaitForExit();

下面是不创建实例的方式!
        System.Diagnostics.ProcessStartInfo FilestartInfo = new System.Diagnostics.ProcessStartInfo(ffmpeg);
        System.Diagnostics.ProcessStartInfo ImgstartInfo = new System.Diagnostics.ProcessStartInfo(ffmpeg);
        FilestartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
        ImgstartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
        FilestartInfo.Arguments = " -i " + fileName + " -ab 56 -ar 22050 -b 500 -r 15 -s " + widthOfFile + "x" + heightOfFile + " " + flv_file;
        ImgstartInfo.Arguments = " -i " + fileName + " -y -f image2 -t 0.005 -s " + FlvImgSize + " " + flv_img;
        System.Diagnostics.Process.Start(FilestartInfo);