用C#调用CMD.exe,执行DOS命令,编码FLV
2007-06-15 23:21
561 查看
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
string strOutput=null;
// p.StandardInput.WriteLine("cd D:\\flv\\mplayer");
// p.StandardInput.WriteLine("cd d:");
p.StandardInput.WriteLine(string.Format("D:\\flv\\mplayer\\mencoder
\"c:\\vs.wmv\" -o \"c:\\output.flv\" -of lavf -lavfopts
i_certify_that_my_video_stream_does_not_use_b_frames -oac mp3lame
-lameopts abr:br=56 -ovc lavc -lavcopts
vcodec=flv:vbitrate={0}:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:dia=4:cmp=6:vb_strategy=1
-vf scale=512:-3 -ofps 12 -srate 22050",200));
p.StandardInput.WriteLine("exit");
strOutput = p.StandardOutput.ReadToEnd();
Console.WriteLine(strOutput);
p.WaitForExit();
p.Close();
记得同时要导入:using System.Diagnostics;命名空间。祝你好运
相关文章推荐
- 用C#调用CMD.exe,执行DOS命令
- c# 程序调用cmd执行命令如SVN.exe
- C#程序调用cmd.exe执行命令
- C#程序调用cmd.exe执行命令
- C# 调用CMD,执行DOS命令
- c# 调用CMD命令执行dos命令
- C# 003 C#调用cmd.exe执行命令
- 用C#调用CMD.exe,执行DOS命令
- java 中调用window系统中的文件,或者执行命令(shell、.CMD、.EXE)并获取返回值(如果有的话)
- 用asp.net调用dos命令~(通过cmd来执行)---转载的
- c#调用cmd执行相关命令
- c#中调用cmd命令执行批处理文件
- Windows系统中Java调用cmd命令及执行exe程序的方法
- C#程序调用cmd执行命令
- C#调用cmd执行命令获取返回值
- C#程序调用cmd执行命令
- c#关闭系统进程以及如何调用cmd并执行命令
- C#调用cmd命令执行msi安装文件
- C#中利用process类调用外部程序以及执行dos命令
- c#关闭系统进程以及如何调用cmd并执行命令