如题,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);
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);
解决方案 »
- web线程问题
- 求一个301界面怎么做
- 导出数据到execl如何设置sheet的名称,向大虾求助
- 跪地求救,上传文件时怎么删除<input type='"file">
- 急!vs2005问题
- 网上下的ASP.net的源码怎么打开啊?
- 有没有办法修改.db文件数据库?有的联系我,现金任务
- 关于版本控制的问题,紧急求助,再开不了工就该卷铺盖走人了。
- http://xml.sz.luohuedu.net/xml/CoolMenu/main.htm (主窗口嵌套子窗口与拖动菜单)怎么做的?(
- 怎么得到通过代理连接的用户的实际IP或网卡地址??
- 怎么在当前页面获取Iframe传过来的参数值
- 关于SinaEditor新浪编辑器上传图片,求救求救
p.WaitForExit();